I would like to ask if this is the proper way to redirect to another page after redux-form submit success:
const form = reduxForm({
form: 'HeroesCreateComponentForm',
validate,
onSubmitSuccess: () => {
console.log('onSubmitSuccess called (yes, yes I do get called');
browserHistory.push('/')
},
});
Did you try using next approach?
react-router-redux
import {push} from 'react-router-redux';
onSubmitSuccess has dispatch function as second parameter. See Redux form. onSubmitSuccess
onSubmitSuccess : (result,dispatch) =>{
dispatch(push('/needed-route'))
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With