I am new to react. I have a component called Register.js
there I call a redux action's method register
. So inside that I want to redirect user to path /dashboard
after the dispatch.
This is my action inside redux
const { REGISTER_USER } = require('./types')
export const register = (values) => async dispatch => {
try {
// register part goes here ...
dispatch({
type: REGISTER_USER,
payload: values
})
} catch (error) {
console.log(error)
}
}
How do I achive this in react?