Hi guys! Today, we discuss about refs in React and how we can utilize it to make fully reusable components. I learned this by looking at the source code of Shadcn-UI, so I am here to share it with you guys who are not yet aware of the full power of refs.
You will learn:
Refs
Forwarded Refs
Typescript with Refs
useImperativeHandle
How Refs are related with the React lifecycle (rerenders)
Check it out:
https://ui.shadcn.com/docs