Using Router Props
Learn how you can access and use the props of React Router.
We'll cover the following
Accessing React Router props
Each component that was rendered by React Router and has been added as a component
prop to a Route
component automatically receives three other props:
match
location
history
Each of these props can be accessed just like any other prop. class components can access these via this.props
whereas function components can access these with props
:
Get hands-on with 1400+ tech skills courses.