How to respect HTTP Location Headers? #13469
Replies: 1 comment
-
I'm not sure if that's an "issue" but is known for sure You're supposed to submit forms using JS (with Form or fetcher.Form) to a React Router action and redirect from there, if you do it it will work If you intercept the request in Express and return a redirect from Express then RR won't follow it because when an action returns a redirect the framework is not sending back a normal redirect response If you want your Express-triggered redirect to work, use form instead of Form/fetcher.Form or add the reloadDocument prop so you will submit the form not using JS but using a document request controlled by the browser With this the browser will receive the redirect and it will follow it |
Beta Was this translation helpful? Give feedback.
-
Upon some form submissions, my backend returns new HTTP 302 location headers using Express.js
res.redirect(...)
functionality.But it seems that react-router isn't honouring them in my SPA. Using your latest version here.
Known issue?
Beta Was this translation helpful? Give feedback.
All reactions