Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Form TypeScript support in documentation #6120

Open
1 task
Tobbe opened this issue Aug 4, 2022 · 1 comment
Open
1 task

Show Form TypeScript support in documentation #6120

Tobbe opened this issue Aug 4, 2022 · 1 comment
Assignees

Comments

@Tobbe
Copy link
Member

Tobbe commented Aug 4, 2022

@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
image

In fact, all code examples should probably have a JS/TS toggle

The <Form> Explained section should explain the <Form<FormData>> syntax

And 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?

  • I'm interested in working on this
@Tobbe Tobbe added the bug/needs-info More information is needed for reproduction label Aug 4, 2022
@Philzen
Copy link
Contributor

Philzen commented Aug 7, 2022

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.

@Tobbe Tobbe self-assigned this Aug 8, 2022
@Tobbe Tobbe removed the bug/needs-info More information is needed for reproduction label Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

2 participants