Add reloadDocument
option to navigate/submit
#8021
gerbyzation
started this conversation in
Proposals
Replies: 1 comment 6 replies
-
FWIW, I think once client data and middleware land, you'll be able to avoid all of the concerns above. Not trying to say we shouldn't pull |
Beta Was this translation helpful? Give feedback.
6 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Following the discussion remix-run/react-router#9859
reloadDocument
was added to remix which on the server side allows you to redirect to a URL path that is managed by another application on the same domain.The server-side redirect is communicated to the front-end via the
X-Remix-Reload-Document
header and executed in the browser:https://github.com/remix-run/react-router/blob/4475b56d2e18014acfb8ff5f6077ff27df98d7fe/packages/router/router.ts#L2255-L2262
This has been working great for predictable scenario's, like redirecting to the login page that is hosted on a different app when a loader/action detects a user is not authenticated.
For other scenario's it would be beneficial to be able to achieve the same effect directly from the browser. Manipulating
window.location
directly does not seem a viable option based on #8011 as it ends up competing with remix. In the response to that issue the proposed solution is to usereloadDocument
on the server side, however this does not seem like an ideal solution:One idea of how this could be accomplished is to add a
reloadDocument
option tonavigate()
:Beta Was this translation helpful? Give feedback.
All reactions