mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-18 06:02:57 +05:30
19 lines
564 B
TypeScript
19 lines
564 B
TypeScript
import React from 'react';
|
|
import { createMemoryHistory } from 'history';
|
|
import storeFactory from 'app/storeFactory';
|
|
|
|
import ContextProvider from './ContextProvider';
|
|
|
|
type ContextProps = React.ComponentProps<typeof ContextProvider>;
|
|
|
|
function TestContextProvider(
|
|
props: Partial<ContextProps> & { children: ContextProps['children'] },
|
|
) {
|
|
const store = React.useMemo(storeFactory, []);
|
|
const history = React.useMemo(createMemoryHistory, []);
|
|
|
|
return <ContextProvider store={store} history={history} {...props} />;
|
|
}
|
|
|
|
export default TestContextProvider;
|