| React Queue Router" data-react-helmet="true">
<Switch/> component is a component that decides which component should be mounted based on currentPath. (See RouterContext page.)
<Switch/> takes only <Route/> components as its children.
import React from 'react'
import {Switch, Router} from 'react-queue-router'
import Top from './Top'
import About from './About'
import NotFound from './NotFound'
const SwitchExample = () => {
return (
<Switch>
<Router path='/' component='Top'>
<Router path='/about' component='About'>
<Router component='NotFound'>
</Switch>
)
}
export default SwitchExample
Property | Type of value | Default value | Required | Description |
---|---|---|---|---|
rememberScroll | Boolean | false | - | Experimental When true, scroll position will be stored and you can come back to the right position when hitting "back" button or "forward" button. This is an experimental feature. All cases are not supported. |