HELP: Strange behaviour with useFetcher in Remix #788
Unanswered
jashiels99
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am getting some strange behaviour when using Conform with the fetcher.Form component.
I have extended the useForm hook into my own hook (useFetcherForm):
I have also extended the fetcher.Form component into my own component:
Firstly, according to the Conform documentation, I should use useActionData to set the lastResult property. This doesn't appear to work. The server-side validation isn't being picked up by the hook, even though it is picked up in the Network tab. So I tried this:
lastResult: fetcher.state === 'idle' ? fetcher.data : nullThis made more sense to me, and the server-side validation errors were now appearing. If I was to submit this form by clicking the submit button, this would all work just fine. However, when the form is submitted by pressing 'Return', it appears I get some sort of race condition (I think??). I have attached a screenshot of the unwanted response.
Beta Was this translation helpful? Give feedback.
All reactions