I use a router like this:
render((
<Router history={browserHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home}/>
<Route path="/detail/:blogId" component={DetailView}/>
</Route>
</Router>
), document.getElementById('app'))
and in blog.jsi useLink
<Link to={{ pathname: "/detail", query: { blogId: this.props.id } }}>Detail</Link>
but it didn’t work, how to replace a part :blogIdwith a condition or props?
source
share