0
if (data.success === true) {
   window.location.replace('/verify')
}

For react function based component I've tried useNavigate hook. What is the equivalent method for React class based component for loading the new page without reloading the entire window, I feel like it would be preferable to load the page via the react-router-dom

1 Answers1

0

There isn't a specific equivalent to useNavigate in class components, but one alternative is that you can wrap your functional component in a class component: https://reactnavigation.org/docs/use-navigation/#using-with-class-component

Window.open() might suit your needs too.

fordat
  • 355
  • 4
  • 13