Skip to content

Commit 4c2276e

Browse files
committed
update
1 parent 91b3aba commit 4c2276e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/routes/reference/jsx-attributes/textcontent.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ tags:
88
- dom
99
version: "1.0"
1010
description: >-
11-
Set an element's `textContent` property from JSX.
11+
Set an element's `textContent` property from JSX with plain text content.
1212
---
1313

14-
`textContent` sets an element's `textContent` property.
14+
`textContent` sets an element's `textContent` property with plain text content.
1515

1616
## Syntax
1717

@@ -23,19 +23,19 @@ description: >-
2323

2424
- **Type:** `string | number`
2525

26-
Text written to the element.
26+
Text written to the element without parsing markup.
2727

2828
## Behavior
2929

30-
- Setting `textContent` replaces the element's existing children with a single text node.
31-
- The value is written through the DOM `textContent` property.
30+
- `textContent` replaces the element's existing child content instead of merging with JSX children.
31+
- On the client, the value is written through the DOM `textContent` property. During SSR, it is emitted as escaped text instead of raw HTML.
3232

3333
## Examples
3434

3535
### Basic usage
3636

3737
```tsx
38-
<div textContent={count()} />
38+
<div textContent={"<strong>Hello</strong>"} />
3939
```
4040

4141
## Related

0 commit comments

Comments
 (0)