history#MemoryHistoryBuildOptions TypeScript Examples
The following examples show how to use
history#MemoryHistoryBuildOptions.
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: index.tsx From react-resource-router with Apache License 2.0 | 6 votes |
MemoryRouter = (props: MemoryRouterProps) => { const { location, children } = props; const config: MemoryHistoryBuildOptions = {}; if (location) { config.initialEntries = [location]; } const history = createMemoryHistory(config); const routerProps = getRouterProps(props); return ( // @ts-ignore suppress history will be overwritten warning <Router history={history} {...(routerProps as RouterProps)}> {children} </Router> ); }