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

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -