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

0

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.