Replies: 1 comment
-
Why this ends up in remix discussion... the link might be wrong in react-router's issue template |
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.
-
In a login page, I do user login and session operation in an
action
handler, and I check the login state in the loader of all other pages. While I finish the session and redirect to the user home, the home page seems to be caching the old state where the user is not logged in.https://reactrouter.com/en/main/hooks/use-revalidator
Looking at the revalidator docs, it mentioned that
useSubmit
would trigger a reload, but that happens too early, as the authentication logic is inside the action which comes after theuseSubmit
. On the other hand, I cannot use the useRevalidator as it is a React hook and apparently I cannot invoke a react hook insideaction
.What should I do now?
Beta Was this translation helpful? Give feedback.
All reactions