Loosen ExtractKeysOfValueType type check on Formik fields
- Dominant language
- TypeScript
- Stars
- 19
- Forks
- 3
- Avg merge
- 46m
- Merged PRs (30d)
- 13
Description
There are issues with field "name" type, I mean the type calculated with the `ExtractKeysOfValueType` utility.
Especially with a nested object form value type, so if the name is like `mapStore.className` the utility can't determine the type falling back to `never`...
I see two options:
- `Formik` is using a simple string type for all names, we could do the same. But it would be a degradation, since `ExtractKeysOfValueType` works nice in 90% of cases.
- Add a possibility to turn strict type of bypassing a ready type value, e.g. in the exanple if passing the second generic argument (string) it won't check with `ExtractKeysOfValueType`
```
options={customClassesOptions}
label="Class Name"
name="mapStore.className"
disabled={Boolean(errorMessage)}
/>
```
Comment from @allfayn
We can take one of these strategies:
- try use default string type as a prop, then not have FormValues
- use the second parameter as above
- use recursive type for this complex form values
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.