Learning on Web Dev Open is free for all.

Framework Internals > Data, forms and the hard partValidate once, trust nowhere
Phase 04Data, forms and the hard part222 of 434

Validate once, trust nowhere

One schema, used for the client hints, the server action and the inferred types, so the three can never disagree.

Build45 minAI implements

Build this in your own editor

This one runs on your machine rather than in the browser workbench. Work to the outcomes below, then come back and mark it complete.

You should now be able to

  • Share a validation schema between client and server
  • Return field-level server errors that the form can display
Ask the community

Loading…