Issue on TypeScript `FieldRenderProps` typings
See original GitHub issueThis typing does not work well with other react libraries.
For example with rc-select
: http://react-component.github.io/select/#select-props
in the onChange
prop you don’t have access to the event, but only the value selected.
This is valid also for onFocus
and onBlur
props
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:6 (2 by maintainers)
Top Results From Across the Web
conflict when extends interface with react-final-form ...
I had the same problem today; I downgraded the versions of react-final-form and final-form and now it's working. Probably it's just a bug...
Read more >Troubleshooting Handbook: Types
Have you read the TypeScript FAQ Your answer might be there! ... Union types are handy for solving some of these typing problems:...
Read more >react-final-form - Bountysource
This commit https://github.com/final-form/react-final-form/issues/864 introduced a breaking change for TypeScript users because now mapped types over FormProps ...
Read more >Documentation - JSX - TypeScript
You can specify the type of children like any other attribute. This will override the default type from, e.g. the React typings if...
Read more >Usage with TypeScript - React Redux
Define Root State and Dispatch Types. Using configureStore should not need any additional typings. You will, however, want to extract the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This might be a tangential issue, but I’m seeing
Form
’scomponent
prop demands a component whose props are defined asFieldRenderProps
, which does not allow additional keys. This means that I’m only allowed props on my custom field components that are defined by React Final Form, which means they can’t be very custom at all. I can get around this with usingchildren
instead but does that feel a little hacky?Since
onChange
should work with a simple value, I workaround-ed it withonChange={(value: string) => (input as any).onChange(value)