Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Root: PreviousRoot => ({ children, ...rest }) => {
const basepath = useBasepath()
const staticInfo = useStaticInfo()
const RouteHandler = props => (
{children}
)
const renderedChildren = (
// Place a top-level router inside the root
// This will give proper context to Link and other reach components
)
Root: PreviousRoot => ({ children }) => {
let Router
const basepath = useBasepath()
const staticInfo = useStaticInfo()
const routerProps = {
basepath, // Required
}
// Test for document to detect the node stage
if (typeof document !== 'undefined') {
// If in the browser, just use the browser router
Router = BrowserRouter
} else {
Router = StaticRouter
routerProps.location = staticInfo.path // Required
routerProps.context = {} // Required
}
return (