When declaring a route like this:
App.js
<Route path="/:id" component={RunningProject} />
I can obtain the id param in RunningProject.js like this
constructor(props){
super(props)
console.log(props.match.params.id);
}
But when declaring the route like this
<Route path="/:id" render={() => <RunningProject getProjectById={this.getProject} />} />
I get an error because match no longer get passed into the props.
How can I pass the match object into the props
using render=
instead of component=
?