Redirecting after submitting an application resultx-form

I would like to ask if this is a suitable way to redirect to another page after resultx-form submit success:

const form = reduxForm({ form: 'HeroesCreateComponentForm', validate, onSubmitSuccess: () => { console.log('onSubmitSuccess called (yes, yes I do get called'); browserHistory.push('/') }, }); 
+5
source share
1 answer

Have you tried the following approach?

react-router-redux

 import {push} from 'react-router-redux'; 

onSubmitSuccess has a send function as the second parameter. See Redux Form. onSubmitSuccess

 onSubmitSuccess : (result,dispatch) =>{ dispatch(push('/needed-route')) } 
0
source

Source: https://habr.com/ru/post/1264297/


All Articles