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
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 : null
This 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.
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
-
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 : null
This 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