You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for this wonderful library. setFieldValue works wonderfully but the first parameter is purely a string which typographical error might become an issue.
Desired Behavior
Strictly define the first parameter should be part of the passed argument for the type of the initialValues if type is defined on the hooks being used (e.g. useFormikContext).
Suggested Solution
Since the Type of the initialValues is strictly defined, I think we can also identify the first parameter as keyof of the actual Type passed as an argument or the actual shape of the object.
Who does this impact? Who is this for?
TypeScript Users - So we can remove the margin for error and no debugging will be needed.
Describe alternatives you've considered
Additional context
As much as possible we try to make it as Object-Oriented as possible and which we also use TypeScript - I feel that strongly-typed string to navigate the property is a little bit off.
I am more than happy to contribute to making this Feature Request working if deemed valid. Thank you!
The text was updated successfully, but these errors were encountered:
Yes, I've realized keyof wouldn't actually be able to cut it for nested implementations but still stated it to spark some discussion. But since this is a dupe, i'll be sure to look out on those referenced PRs. Thank you!
🚀 Feature request
Current Behavior
First of all, thank you for this wonderful library.
setFieldValue
works wonderfully but the first parameter is purely a string which typographical error might become an issue.Desired Behavior
Strictly define the first parameter should be part of the passed argument for the type of the
initialValues
iftype
is defined on thehooks
being used (e.g.useFormikContext
).Suggested Solution
Since the Type of the
initialValues
is strictly defined, I think we can also identify the first parameter askeyof
of the actual Type passed as an argument or the actual shape of the object.Who does this impact? Who is this for?
TypeScript Users - So we can remove the margin for error and no debugging will be needed.
Describe alternatives you've considered
Additional context
As much as possible we try to make it as Object-Oriented as possible and which we also use TypeScript - I feel that strongly-typed string to navigate the property is a little bit off.
I am more than happy to contribute to making this Feature Request working if deemed valid. Thank you!
The text was updated successfully, but these errors were encountered: