2020-05-21 23:38:47 +05:30
|
|
|
import React from 'react';
|
|
|
|
import { createMemoryHistory } from 'history';
|
|
|
|
import storeFactory from 'app/storeFactory';
|
|
|
|
|
|
|
|
import ContextProvider from './ContextProvider';
|
|
|
|
|
|
|
|
type ContextProps = React.ComponentProps<typeof ContextProvider>;
|
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
function TestContextProvider(props: Partial<ContextProps> & { children: ContextProps['children'] }) {
|
|
|
|
const store = React.useMemo(storeFactory, []);
|
|
|
|
const history = React.useMemo(createMemoryHistory, []);
|
2020-05-21 23:38:47 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
return <ContextProvider store={store} history={history} {...props} />;
|
2020-05-21 23:38:47 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
export default TestContextProvider;
|