Answer the question
In order to leave comments, you need to log in
React router 4, correctly passing path parameters?
Good evening, please tell me, I'm making a router on react-router 4, or rather I started reading the manual, it was on the old version, and the question is how right I did
<Route path="/repos/details/:repo_name"
render={({match}) => <RepoDetails repo_name={match.params.repo_name} />} />
Answer the question
In order to leave comments, you need to log in
If it's still relevant, then you can
<Route path="/repos/details/:repo_name"
render={(props) => <RepoDetails repo_name={props.match.params.repo_name} />} />
<Route path="/repos/details/:repo_name"
render={(props) => <RepoDetails {...props} />} />
const repoName = this.props.match.params.repo_name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question