Answers for "routes from switch react router dom"

1

react router change route from function

import {withRouter} from 'react-router-dom';
this.props.history.push('route');
export default withRouter(your component name)
the react component should be wrapped with withRouter hoc 
so that history will work
Posted by: Guest on March-07-2021

Code answers related to "routes from switch react router dom"

Code answers related to "Javascript"

Browse Popular Code Answers by Language