useFormikContext and TypeScript #3924
Unanswered
runoncedev
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Or even how to assign a values type to |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've a large form which is divided into several smaller components, each of this components use
useFormikContext()
to get info likevalues
,touched
,erros
, and so on.I've created a separated file with the type for my form:
Which I pass to the context hook:
And also use it for the initial form values:
It works fine, but I was wondering, is there a better way for doing this? I was hoping to be able to get Formik to generate this type for me vs doing it manually, is this possible?
Beta Was this translation helpful? Give feedback.
All reactions