pass props router code example
Example 1: route pass props to component
<Route
path='/dashboard'
render={(props) => (
<Dashboard {...props} isAuthed={true} />
)}
/>
Example 2: pass props
class Welcome extends React.Component {
render() {
return <h1>Hello, {this.props.name}</h1>;
}
}