-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v11 types: new shouldForwardProp type is overly restrictive #1641
Comments
I don't think this issue is very severe: one can explicitly annotate the
|
Ah I see, the prop is added to the types after the create styled. Good point. Thoughts on if it should allow |
|
Giving it a go, |
We believe this got fixed by #1643, once we release a new version please take a look to check out it this resolved your issue. |
Current behavior:
I have been trying out the new @next tags, and have run into a type error with code that previous type-checked and worked. I'm fairly certain this is due to the changes in #1624
The
shouldForwardProp
option is now inferred to being of type(prop: keyof Props) => prop is ForwardedProps
. But this restrictsprop
to being one of the known props of an element type.To reproduce:
See the code sandbox for an example that used to work and now fails
Expected behavior:
I think that the argument to
shouldForwardProp
should always just be astring
, since at the momentstyled
is called, we don't know what additional props the component might accept.Environment information:
The text was updated successfully, but these errors were encountered: