Type a polymorphic as prop in a React component
christianvm.dev
This tutorial builds an as prop that changes the rendered HTML element while preserving valid property types. TypeScript generics help prevent attributes from leaking between different tags.
