I want to redirect the client after an action has been fired. I heard of react-redux-router, but not sure how to properly implement it in the actions function.
i followed a little bit of this
https://stackoverflow.com/a/42985875/10865515
However, when i submit the validated form, it doesn't redirect or refreshes.
Actions.js
 import { auth as firebaseAuth } from '../firebaseConfig'
 import { push,  browserHistory } from 'react-router-redux';
 export const signUp = (user) => { return (dispatch) => {
  firebaseAuth.createUserWithEmailAndPassword(user.email, user.password)
    .then(() => {
        dispatch({ type: 'SIGNUP_SUCCESS',
        payload: (action, state, res) => {
            return res.json().then(json => {
              browserHistory.push('/');
              return json;
            });
          },
    });
    }).catch((err) => {
        dispatch({ type: 'SIGNUP_ERROR', err});
    });
  }  
}
Reducers.js
const initialState = {
  emailSignUp: '',
  passwordSignUp: '',
  authError: null
}
export default (state = initialState, action) => {
  switch (action.type) {
    case 'SIGNUP_SUCCESS':      
        return ({
            ...state,
            authError: null
        })
    case 'SIGNUP_ERROR':
        console.log('signup error')
        return ({
            ...state,
            authError: action.err.message
        })
    default:
        return state
 }
} 
Register.js
// ...
handleSubmit(event) {
    event.preventDefault();
    const {formData, errors} = this.state;
    const {email, password} = formData;
    const myError = this.props.authError;
    const creds = {
        email,
        password
    }
    const register = this.props.signUp(creds);
    if (register) {
        console.log(creds);
    }
}
 
     
    