-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
innerRef in WithTheme broke compatibility to styled components #12250
Comments
@Mario-Eis Could you provide a full reproduction? It would help a lot. |
I'm sorry, I've not been able to recreate the issue in a sandbox. The type checking in the sandboxes did not work like the local checks. I solved the issue in my project by upgrading typescript and replacing As I understood, innerRef is used by styled components to pass down component refs. So there is a conflict between the innerRef in WithTheme and styled-components. I also figured out, that they are going to remove innerRef in 4.0 anyway: styled-components/styled-components#1560 (comment) |
This should be fixed by #14333 which was released in 3.9.2 |
Since 1.4.1 there is an issue when using styled components together with the WithTheme interface.
innerRef on WithTheme broke property spreading to styled components
this seems to be related to #12216
e.g. after 1.4.1 this will produce a type error:
sytled components seems to define the innerRef prop for its own purposes with a different type.
Writing the following may (?) work, but its a wokaround and dosn't use the appropriate type interface.
Expected Behavior
WithTheme should be compatible to styled components.
Current Behavior
WithTheme is not compatible to styled components.
Steps to Reproduce
see above
Your Environment
Update: Maybe, if the type names collide, this is not entirely a typescript issue only. Feels like the innerRef prop could have multiple usages here and get overwritten (?)
The text was updated successfully, but these errors were encountered: