Replies: 1 comment
-
If you need to navigate outside the react tree, you can use the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I encapsulated a fetch request function to handle some common Error catch & throw.
and one is Error 401, user has no authority.
in this way, I need to Toast and redirect to login page.
my code follows:
I read the document and find redirect is only usefull in a loader or action
and useNavigate is only usefull in a react context.
so I try the history.pushState(),
which can change the url but page is not changed. and no loader is executed
So, I want this method, a redirect function which can be used outside a react context and loader & action.
Beta Was this translation helpful? Give feedback.
All reactions