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

Popular posts from this blog

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Create a stacked percentage column -