import * as React from 'react' ; import { DataProvider } from '../types' ; import useDataProviderWithDeclarativeSideEffects from './useDataProviderWithDeclarativeSideEffects' ; export interface DataProviderProps { dataProvider : DataProvider ; } see useDataProvider example const withDataProvider = < P extends object > ( Component ) : React . FunctionComponent < P & DataProviderProps > => ( props ) => ( < Component { ... props } dataProvider = { useDataProviderWithDeclarativeSideEffects ( ) } / > ) ; export default withDataProvider ;