Skip to content
This repository has been archived by the owner on Dec 23, 2022. It is now read-only.

TypeScript definitions incorrectly inherit "ref" definition from FormControl #312

Open
benwiley4000 opened this issue Apr 7, 2020 · 0 comments

Comments

@benwiley4000
Copy link
Contributor

FormControl is wrapped in forwardRef so its ref prop must handle a div element. However a ref prop passed to ChipInput would receive a component ref. Because ChipInput inherits FormControl's props definition and omits only onChange, TypeScript is misled about the definition of the ref prop.

I'm using a component ref in my code to call setState() from the parent component (yes I know this is bad, I'll open an issue shortly about the behavior I'm implementing 🙂).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant