Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/middleware/legacy-routes-redirect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const LEGACY_ROUTES = {
"/references/api-reference/secondary-primitives/createSelector": "/reference/secondary-primitives/create-selector",
"/references/api-reference/special-jsx-attributes/attr_": "/reference/jsx-attributes/attr",
"/references/api-reference/special-jsx-attributes/classList": "/reference/jsx-attributes/classlist",
"/references/api-reference/special-jsx-attributes/innerHTML-or-textContent": "/reference/jsx-attributes/innerhtml-or-textcontent",
"/references/api-reference/special-jsx-attributes/innerHTML-or-textContent": "/reference/jsx-attributes/innerhtml",
"/references/api-reference/special-jsx-attributes/on_": "/reference/jsx-attributes/on_",
"/references/api-reference/special-jsx-attributes/on_-and-oncapture_": "/reference/jsx-attributes/on",

Expand Down
3 changes: 2 additions & 1 deletion src/routes/reference/jsx-attributes/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"attr.mdx",
"classlist.mdx",
"bool.mdx",
"innerhtml-or-textcontent.mdx",
"innerhtml.mdx",
"textcontent.mdx",
"on_.mdx",
"on.mdx",
"once.mdx",
Expand Down
10 changes: 0 additions & 10 deletions src/routes/reference/jsx-attributes/innerhtml-or-textcontent.mdx

This file was deleted.

12 changes: 12 additions & 0 deletions src/routes/reference/jsx-attributes/innerhtml.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: innerHTML
---

The `innerHTML` attribute is equivalent to the [`innerHTML` DOM property](https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML).
This attribute replaces all existing nodes of the element with new nodes generated by parsing the provided string as HTML.

:::caution

Using `innerHTML` with unsanitized user-supplied data can introduce security vulnerabilities.

:::
8 changes: 8 additions & 0 deletions src/routes/reference/jsx-attributes/textcontent.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
title: textContent
---

The `textContent` attribute is equivalent to the [`textContent` DOM property](https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent).
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.
Loading