score:1

Accepted answer

so after talking about it for a bit. figured out what you were wanting to do.

you need to define a new route in react-router that you can use for this history change.. something like this:

<route exact path="/:name" component={somecomponent} /> 

in your component you have access to this "name" via this.props.params.name

you can also call an action to update the store before updating this route


note: if you stay with v2... you should make your actions return a promise, so that you can just chain the event in your component. aka:

onchange={this.handlechange}

handlechange = (value) => { // assuming you have the value here.. it may be e is the function param and you get the value as e.target.value
    this.props.saveselectedanimal(value).then( () => {
        this.props.history.push("/"); 
    })
}

Related Query

More Query from same tag