September 2018
Beginner
156 pages
3h 28m
English
We have already taken a look at how the component prop can be used to render a view when the <Route> path matches the browser's location.pathname. There are two other props available to render a view: render and children.
The render prop is used for inline rendering. The function mentioned as a value to the render prop should return a React element similar to the following:
<Route path="/user" render={() => ( <div> Inside User Route </div> )}/>
From the preceding code snippet, when the '/user' path matches the browser's URL, the function specified as a value to the render prop is executed, and the React element returned from this function is rendered.
Read now
Unlock full access