You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came from remix, I figure I post it here because the utils derive from here.
I want to use fetcher.Form to post to an action with redirects without manipulating the history stack.
with Form it seems to work, I suppose it's because replace defaults to be true when redirecting to the same url.
but I can't get it to work with fetcher.Form, as replace don't seem to exist on it and it doesn't handle it internally either.
In the example should be able to see that when action is redirecting to the same url, fetcher.Form still pushes a new entry onto the history stack.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
here is some example code:
https://stackblitz.com/edit/vitejs-vite-8dffrs?file=src%2Fmain.tsx,src%2Froutes%2Froot.tsx&terminal=dev
I came from remix, I figure I post it here because the utils derive from here.
I want to use
fetcher.Form
to post to an action with redirects without manipulating the history stack.with
Form
it seems to work, I suppose it's becausereplace
defaults to be true when redirecting to the same url.but I can't get it to work with
fetcher.Form
, asreplace
don't seem to exist on it and it doesn't handle it internally either.In the example should be able to see that when action is redirecting to the same url,
fetcher.Form
still pushes a new entry onto the history stack.Beta Was this translation helpful? Give feedback.
All reactions