1

Is there a way to use useNavigate() hook outside functional component in react-router v6? I'm trying to use navigate(url) inside a saga function. I know in v4 we could do something like this:

const history = createBrowserHistory();
function* sagaFunc(){
 history.push(url)
}
Drew Reese
  • 103,803
  • 12
  • 69
  • 96

0 Answers0