textContent
Edit this pagetextContent sets an element's textContent property with plain text content.
Syntax
<div textContent={value} />Value
- Type:
string | number
Text written to the element without parsing markup.
Behavior
textContentreplaces the element's existing child content instead of merging with JSX children.- On the client, the value is written through the DOM
textContentproperty. During SSR, it is emitted as escaped text instead of raw HTML.
Examples
Basic usage
<div textContent={"<strong>Hello</strong>"} />