useNavigate outside of router - for example on authentication faiures?
I have a file of functions for interacting with my backend, I'd like to consolidate some error handling there, for example, if there is an authentication failure, redirect.
But as these are not in a router, I can't
useNavigate
useNavigate
, even though all these functions are called from a component under a router.