Behind the ‘as’ prop: polymorphism done well
4 min read
Updated
A button renderable as a link has quirky types in React. How could custom tags be assigned to such components?
I’m a software engineer with a special interest in accessibility. Building for the web, I mainly use React and Tailwind CSS nowadays.
A button renderable as a link has quirky types in React. How could custom tags be assigned to such components?
While plain components support generic props out of the box, wrappers like ‘forwardRef’, ‘lazy’ and ‘memo’ are cumbersome in that regard.
Launching a blog sounds fairly simple, but getting lost in the details is just as easy. My take on obsessive hobbyism.