question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

styled forwardRef argument works, but there are no types for it

See original GitHub issue

Hi @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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
cristianbotecommented, Oct 27, 2020

published goober@2.0.12 with the patch 👍

2reactions
devrntcommented, Oct 26, 2020

Ofcourse! @cristianbote

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found