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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine Field Component Typing #3896

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

qwezey
Copy link

@qwezey qwezey commented Oct 4, 2023

This PR enhances the typing within the Field component, resolving a prior issue where all props were implicitly assigned the type of any. A minor change set has been introduced because consumers of the Field component were previously able to (incorrectly) pass in any prop of any type. With this fix, some dependent TypeScript projects may need to refactor their code to provide the correct values for the compiler to avoid errors. If this doesn't necessitate a minor change set, I can adjust it to a patch accordingly.

This commit enhances the typing within the Field component, rectifying a prior issue that had resulted in all props being implicitly assigned the type of any.
@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2023

🦋 Changeset detected

Latest commit: bc0948a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
formik Minor
formik-native Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Oct 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
formik-docs ⬜️ Ignored (Inspect) Visit Preview Oct 4, 2023 5:29pm

@qwezey qwezey changed the title Fix-field-typing Refine Field Component Typing Oct 4, 2023
@qwezey qwezey marked this pull request as ready for review October 4, 2023 17:43
@qwezey
Copy link
Author

qwezey commented Oct 6, 2023

@jaredpalmer @probablyup is this something we can get out? this fix makes working with the Field component in typescript much easier

@Zikoat
Copy link

Zikoat commented Dec 14, 2023

There are some issues with this, namely that custom props which are required by a custom component cannot be passed to Field because the props type to field doesnt include the props from the custom component. We will need another generic for this or change the structure. I will take a crack at this, but I have to discuss it in a new issue so Jared gives a thumbs up before I spend a lot of time on it.

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.

None yet

2 participants