jaredpalmer / jaredpalmer/formik
`FieldProps` type is not accepting proper generic type.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 34.3k
- Forks
- 2.8k
- PR merge metrics
- No merged PRs in 30d
Description
🐛 Bug report
Current Behavior
FieldProps type accepts just one generic type where it uses same type both for field and form values. I think it is not correct behavior.
Expected behavior
Expected behavior is that FieldProps should accept 2 generic type.
Suggested solution(s)
It should accept 2 types, one for meta and field, another one for form key like below.
export interface FieldProps<V = any, FV = any> {
field: FieldInputProps<V>;
form: FormikProps<FV>;
meta: FieldMetaProps<V>;
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/Field.tsx line 13, where FieldProps is defined, and inspect the related FieldInputProps, FormikProps, and FieldMetaProps types. Confirm the generic relationships and verify that FieldProps can represent distinct field/meta and form value types; done when the type definition and relevant type checks support the reported usage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100