I am new in react. I want my app to have multiple layouts for different pages with react router. The code below was found in https://gist.github.com/avinmathew/e82fe7e757b20cb337d5219e0ab8dc2c
// Custom route component
const AppRoute = ({ component: Component, layout: Layout, ...rest }) => (
<Route {...rest} render={props => (
<Layout>
<Component {...props} />
</Layout>
)} />
)
// Actual routes
<Switch>
<AppRoute exact path="/foo" layout={MainLayout} component={Foo} />
<AppRoute exact path="/bar" layout={AltLayout} component={Bar} />
<AppRoute exact path="/bar2" layout={AltLayout} component={Bar2} />
</Switch>
My question is that will the layout be re-rendered after change of pages using same layout, (e.g. from /bar to /bar2)?