JSX Attributes

textContent

The textContent attribute is equivalent to the textContent DOM property. This attribute replaces all existing child nodes of the element with a single text node containing the provided string.

Using textContent can improve performance when the element's children are known to be exclusively text, as it bypasses the generic diffing process.

Last updated: 3/24/26, 3:52 PMEdit this pageReport an issue with this page