Closed chernodub closed 1 year ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
formik-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Jul 9, 2023 0:29am |
Latest commit: 4910b4046570a7acdf2071b3ac2788521d24d8df
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Good start! These APIs allow for deep.path.key
notation, so we'll need a utility type to extract all the deep object keys versus just the surface-level ones. Something like this could work: https://dev.to/pffigueiredo/typescript-utility-keyof-nested-object-2pa3
Pretty much everywhere we take a field name
would benefit from this.
Hi @probablyup! I was finally able to find some time to work on this, and I improved the overall implementation. Now, all the methods that accept field names are strictly-typed. I also added some tests for this. Feel free to play around in a new example project I created.
Here's a small example of how it works:
Seems that the repo is inactive, I'm closing the PR
Hi, I noticed that when using
getFieldMeta
andgetFieldHelpers
, IDE does not provide the list of the names of the form fields. So I made a non-breaking update toFormikHandlers
interface.This way we are able to leverage typed argument in
getFieldMeta
andgetFieldHelpers
to (1) avoid possible bugs after refactoring and (2) get a better DX when working with formik.Example:
Please let me know if more updates or clarifications needed. Thanks!