styled forwardRef argument works, but there are no types for it
See original GitHub issueHi @cristianbote! Thanks for this project! This is probably just a simple oversight, but I’ve noticed that despite styled
taking a second argument forwardRef
, and it being documented as such, there are no types for that argument; every version of the function is typed as only taking a single argument. If I create a component using styled as any
, the forwardRef
argument behaves at runtime exactly as I expect.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
[styled-components] Cannot use forwardRef with ... - GitHub
I can use forwarded ref on regular input, but not with styled one, it gives weird Typescript error, I am not sure what...
Read more >reactjs - Typescript RefForwardingComponent not working
RefForwardingComponent is a render function, which receives props and ref parameters and returns a React node - it is no component:.
Read more >How to use React's forwardRef function - Felix Gerschau
forwardRef accepts two generic types. The first one defines the type of the reference, while we can use the second one for the...
Read more >Annotating React Styled Components with TypeScript -- newline
Styled components redefine how we apply CSS styles to React components. Unlike the traditional approach of manually assigning CSS classes ...
Read more >Forwarding Refs - React
Regular function or class components don't receive the ref argument, and ref is not available in props either. Ref forwarding is not limited...
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
published
goober@2.0.12
with the patch 👍Ofcourse! @cristianbote