0
Hello, I’m starting to work with React and I’m doing an integration with Firebase. My problem is this, I can already fire all the actions I need, but when I fire my last action USUARIO_ENTRAR_SUCESSO
I need the react-router-dom
navigate to the route /:uid
.
My brother is like this:
export const usuarioReducer = (state = initialState, action) => {
switch(action.type) {
// ...outras actions...
case 'USUARIO_ENTRAR_SUCESSO': {
// preciso navegar quando essa action for disparada
return state;
}
default:
return state;
}
}
How do I do that?
Reducer should never interact this way with the application! All navigation should be done through the actions, Reducer only changes the state.
– Vinícius Carra
means then that instead of me calling the Reducer, I can simply fire an action?
– LeandroLuk