Using createCookie
in a route module causes fetcher.Form
to do a document reload on submission
#9783
Labels
createCookie
in a route module causes fetcher.Form
to do a document reload on submission
#9783
Reproduction
Head to https://stackblitz.com/edit/node-vqpqlv?file=app%2Froutes%2Findex.tsx , and click the submit button on the form.
You should see that the page does a full reload on submission (it's a bit easier to see if you open the stackblitz preview in a new tab).
System Info
Used Package Manager
npm
Expected Behavior
fetcher.Form
submits without causing a navigation or document reload regardless of whether a cookie is defined in the route module.Actual Behavior
Defining a cookie in a route module causes
fetcher.Form
subission to do a page navigation / document reloadℹ️ Update: Workaround
Moving the
createCookie
call to a module that is not your route module then importing it should prevent this issue.The text was updated successfully, but these errors were encountered: