Answers for "redirect page in react router dom push"

1

react-router-dom redirect on click

import { useNavigate } from 'react-router-dom';
...
const navigate = useNavigate()
...
navigate('./create', { replace: true });
Posted by: Guest on December-08-2021
2

how to redirect react router from the app components

state = { redirect: null };
render() {
  if (this.state.redirect) {
    return <Redirect to={this.state.redirect} />
  }
  return(
  // Your Code goes here
  )
}
Posted by: Guest on June-08-2020

Code answers related to "redirect page in react router dom push"

Code answers related to "Javascript"

Browse Popular Code Answers by Language