history#MemoryHistory TypeScript Examples
The following examples show how to use
history#MemoryHistory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: test-utils.tsx From fhir-validator-app with Apache License 2.0 | 7 votes |
renderWithRouter = ( ui: JSX.Element, { route = '/', history = createMemoryHistory({ initialEntries: [route] }) }: RenderOptions = {} ): RenderResult & { history: MemoryHistory } => { const Wrapper: FC = ({ children }) => <Router history={history}>{children}</Router>; return { ...render(ui, { wrapper: Wrapper }), history, }; }
Example #2
Source File: testUtils.tsx From twilio-voice-notification-app with Apache License 2.0 | 6 votes |
makeContextWrapper = (
history: MemoryHistory
): React.FC<{
children?: ReactNode;
}> => ({ children }) => (
<Provider store={store}>
<Router history={history}>
<HttpProvider>{children}</HttpProvider>
</Router>
</Provider>
)