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
@Philzen mentioned in a comment on another issue that it would be good to show how one can use types with our forms, and I agree!
So I'm writing up this issue so we don't forget 馃檪
He mentioned adding it to the tutorial, and that's a good call. I'm not sure if anyone has gone through the tutorial and updated it since the TS Strict mode PR #5491 got merged. So it's possible the tutorial is lacking in more places.
May be out of scope, but while we're at it, i'd really love to see the 2nd parameter passed of onSubmit also documented somewhere. From the current tutorial and docs it is missing that that includes the submit event, which is the default first parameter for non-Redwood submit callbacks.
@Philzen mentioned in a comment on another issue that it would be good to show how one can use types with our forms, and I agree!
So I'm writing up this issue so we don't forget 馃檪
He mentioned adding it to the tutorial, and that's a good call. I'm not sure if anyone has gone through the tutorial and updated it since the TS Strict mode PR #5491 got merged. So it's possible the tutorial is lacking in more places.
We also have a page on forms in our reference section https://redwoodjs.com/docs/forms that could show how to use types
This example at the top could have a JS/TS toggle
In fact, all code examples should probably have a JS/TS toggle
The
<Form>
Explained section should explain the<Form<FormData>>
syntaxAnd in https://redwoodjs.com/docs/forms#using-formmethods we should show
const formMethods = useForm<FormData>()
How do we reproduce the bug?
No response
What's your environment? (If it applies)
No response
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: