reactjs - React Router v4 Redirect with parameters -
i have route set up:
<route path="/search/:name" component={foo} />
in component trying redirect based on entered name:
<redirect to="/search" />
i want pass this.state.name
redirect, /search/name
. how?
resolved:
i had wrap in curly braces so:
<redirect to={"/search/" + this.state.name} />
(thanks giri guidance)
Comments
Post a Comment