fix: Missing ForwardRefExoticComponent
and RefAttributes
types in compat
#3996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #3759, though only the immediate issue.
Popper
from@mui/material
still does not type check correctly -- I added about a half-dozen types in compat and still couldn't get any type errors. We're missing a fair few things I guess, but that lib is such a maze of imports that I couldn't even track down all of what we were missing. Issue for another day I think?Adapted from React's types here and here
To provide a simpler and more cut down reproduction than the original issue provided, the following example React library will generate the following types:
Aliasing
react
topreact/compat
using"paths"
in atsconfig.json
would convert the type ofMyInput
intoany
asForwardRefExoticComponent
andRefAttributes
could not be found.