react-router-example
react-router-example copied to clipboard
can please provide example with PrivateRoute with Menu
Hi, Thanks for providing example,
can please provide example with PrivateRoute with Menu, which will not re-render menu
Hi,
Can you elaborate more on your request?
If you wanna have a navigation menu, you can put inside the BrowserRouter, then when you change the Route, the Menu won't be re-render.
<BrowserRouter>
<Menu />
<Switch>
<PublicRoute restricted={false} component={Home} path="/" exact />
<PublicRoute restricted={true} component={SignIn} path="/signin" exact />
<PrivateRoute component={Dashboard} path="/dashboard" exact />
</Switch>
</BrowserRouter>