The <Form> component in Inertia does not provide strong type safety by itself #2551
ramosramosramos
started this conversation in
Ideas
Replies: 1 comment
-
We're exploring this and working on it :) |
Beta Was this translation helpful? Give feedback.
0 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.
-
Problem
Currently, the
<Form>
component in Inertia is great for quick usage, but it lacks TypeScript type safety.All form fields are treated as untyped strings, which leads to:
Example (current behavior)
Proposed Solution
Allow the
<Form>
component to accept a generic type for itsdata
shape, similar to howuseForm<T>()
works.Example (proposed)
Benefits
<Form>
with the type-safety already available inuseForm<T>()
Beta Was this translation helpful? Give feedback.
All reactions