I’m relatively new to remix.run and try to follow the best practices (e.g. use forms for everything).
Today I wanted to have a form for an action that does not update the URL. If I kept it with the default form, refreshing the page would lead to an error because I didn’t want to add a loader to the action route.
It turns out, there is a useFetcher hook, that also provides a <fetcher.Form> component, which works just like a regular form but does not redirect the user to the form action URL.
Neat!

Leave a Reply