Repository navigation
Replies: 7 comments 9 replies
|
Yep - I'm on board. @jacob-ebey and I actually almost shipped this as part of v7 so we can dust that off. At the time we were (probably needlessly) waffling on whether we needed reset or abort or both etc. Let's just ship |
|
Sounds great. Will this issue show when it's merged into main or a development branch? |
|
Late to the party but this seems to work (perfect) for my use case. useFormFieldEmptied(searchValue, () => fetcher.unstable_reset());Much appreciated folks π |
|
Just tested as well and it works beautifully. Thanks for shipping this! |
|
Much love for this feature. Thanks @brophdawg11! Previously, to accomplish this little UX I'd have to pull in useState and keep another state in sync. fetcher-reset.movNow I can just do this: onChange={() => {
if (isSuccess) {
fetcher.unstable_reset();
}
}} |
|
Closing - this shipped as unstable in 7.9.2 and stabilized in 7.10.0 |
Uh oh!
There was an error while loading. Please reload this page.
I am using useFetcher to submit form data without navigation within a modal. When a user submits data within the modal and closes the modal I would like clear the fetcher state so when the user re-opens the modal they get the same experience as the first usage.
I can work around this by rendering the modal only when needed which mounts and unmounts the modal component but this seems sub-optimal. Ex:
See discussion at remix-run/remix#2749.
All reactions