final-form / final-form/react-final-form
Different form state and component FieldValue types
- Dominant language
- JavaScript
- Stars
- 7.4k
- Forks
- 497
- PR merge metrics
- No merged PRs in 30d
Description
### Are you submitting a **bug report** or a **feature request**?
Can be bug.
### What is the current behavior?
In current TS implementation you cannot make `FieldProps` to have different types for state and renderable component.

It throws error:
```
Type 'string' is not assignable to type '{ type: "string"; data: string; }'.
```
In `UseFieldConfig` type `FieldValue` represents value passed to state and it cannot be changed.

**Not sure how to fix it:**
- "flip" `FieldValue` and `any` in `UseFieldConfig`
- fix `FieldProps` somehow
**Temp workaround**
```ts
type TempWorkaround = FieldProps>;
```
### What is the expected behavior?
You can set input component value and state value types.
### Sandbox Link
https://codesandbox.io/s/vibrant-leakey-el0fn?file=/src/index.tsx
### What's your environment?
### Other information
Contributor guide
Assessment
This issue has not been assessed yet.