typescript-cheatsheets / react

Cheatsheets for experienced React developers getting started with TypeScript

Home Page:https://react-typescript-cheatsheet.netlify.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Advanced] Wrapping/Mirroring a Component with ref forwarding

pierreburel opened this issue · comments

What cheatsheet is this about? (if applicable)

Advanced cheatsheet

What's your issue or idea?

I'm afraid the TODO: doublecheck this part regarding second layer ref forwarding in Useful Patterns by Use Case › Wrapping/Mirroring a Component is indeed not working.

Here's a sandbox showing that there's no TS error, but the ref is not really forwarded as using it has no effect: https://codesandbox.io/s/typescript-cheatsheets-correction-jr92sc