import React, { ComponentType } from 'react'; import { createMemoryHistory } from 'history'; import { DeepPartial } from 'utility-types'; import storeFactory from 'app/storeFactory'; import { State as RootState } from 'app/types'; import ContextProvider from './ContextProvider'; type NotOverriddenProps = Omit, 'store' | 'history'>; type Props = NotOverriddenProps & { state?: DeepPartial; }; const TestContextProvider: ComponentType = ({ state = {}, children, ...props }) => { const store = React.useMemo(() => storeFactory(state), []); const history = React.useMemo(createMemoryHistory, []); return ( {children} ); }; export default TestContextProvider;