Say I have a route for react that looks like below route:
<Route path="/" component={Layout}>
<IndexRoute component={home}></Route>
<Route path="user" component={user}></Route>
</Route>
Where the Layout component has just the header and footer only but the main content of the webpage is loaded from the child routes. Home is the index route and /user renders the user route inside the Layout component. To display the content of the home or user component inside the Layout route, you need to include below code in the Layout route: