# Type a polymorphic as prop in a React component

Canonical source : [Type a polymorphic as prop in a React component](<https://sebastien.rigaux.be/en/tech-watch/links/type-a-polymorphic-as-prop-in-a-react-component>)

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.

- Selected on : 2025-02-22

- Resource publication : 2024-03-25

- Entry updated : 2026-10-14T07:00:28+0000

- Format : Article

- Source language : EN

Original resource : [Type a polymorphic as prop in a React component](<https://christianvm.dev/blog/react-as-prop>)

Tags : [React](<https://sebastien.rigaux.be/en/tech-watch/tags/react>) · [TypeScript](<https://sebastien.rigaux.be/en/tech-watch/tags/typescript>)

Available versions : [Français](<https://sebastien.rigaux.be/veille/liens/typer-une-prop-polymorphe-as-dans-un-composant-react>) · [English](<https://sebastien.rigaux.be/en/tech-watch/links/type-a-polymorphic-as-prop-in-a-react-component>)

[Back to tech watch](<https://sebastien.rigaux.be/en/tech-watch>)
