Skip to content

feat: allow add types when we use FormState type#475

Open
mau2099 wants to merge 1 commit intoteslamotors:masterfrom
mau2099:feat/optional-types-form-state
Open

feat: allow add types when we use FormState type#475
mau2099 wants to merge 1 commit intoteslamotors:masterfrom
mau2099:feat/optional-types-form-state

Conversation

@mau2099
Copy link

@mau2099 mau2099 commented Nov 12, 2024

so that way, we can do:

  const handleOnSubmit = async ({ values }: FormState<AttendanceDetailsForm>) => {
   ...
  }

but we can still use former way, so no breaking changes

  const handleOnSubmit = async ({ values }: FormState) => {
   ...
  }

*Note: changes based on this chart https://teslamotors.github.io/informed/api-reference/fieldState

@mau2099 mau2099 force-pushed the feat/optional-types-form-state branch from 80aa6f3 to 3c561c7 Compare November 12, 2024 18:49
@mau2099
Copy link
Author

mau2099 commented Nov 12, 2024

maintainer is requiring at least 3 thumbs up here from senior typescript devs, so if you are seeing this, drop your thoughts!

@raff-wakflo
Copy link

I believe this is great for having strictly typed form schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants