Replies: 1 comment 3 replies
-
|
Hey @penx! You nerd-sniped me into putting up an Astro example in #1177 😄 After playing with it a bit more, I think the right way to think about Astro support is as a hybrid model:
It's mostly working. I just found a bug in the async validation form, but it's an issue from the Conform side. The only example I couldn't port over is "async validation via server validation", mainly because the server submission causes a document reload and the input loses focus. I think we can support that properly once Conform exposes a hook that lets user intercepts the submit event used for server validation. |
Beta Was this translation helpful? Give feedback.
3 replies
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.
-
Astro recently introduced Actions where they list "a solution to client-side validation" as a non-goal as there are "several community libraries to choose from".
Astro actions take a zod schema, but I think that in order to accept a form post from the client without JavaScript, this schema needs to be flat.
Integration with react-hook-form and I think Conform is possible, but there is a trade off - either lose the non-js form-submit fallback (which is essential for non-hydrated islands and a nice feature of Conform) or use a flat zod structure.
The goals of Astro seem well aligned to those of Conform, so I think they would be a good match. I think Conform already has code to handle a non-JS fallback of a form submit for nested zod struture. It would be great to see this approach working alongside Astro actions, perhaps this requires collaborating with the Astro team @bholmesdev @ascorbic
I'm creating this discussion to see:
Beta Was this translation helpful? Give feedback.
All reactions