Skip to content

Commit 05cfd33

Browse files
committed
update
1 parent 9515e10 commit 05cfd33

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • src/routes/reference/jsx-attributes

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ tags:
99
- optimization
1010
version: "1.0"
1111
description: >-
12-
Mark a JSX expression so the compiler does not wrap it reactively.
12+
Mark a JSX expression as static at compile time.
1313
---
1414

15-
`/*@once*/` marks a JSX expression so the compiler does not wrap it reactively.
15+
`/*@once*/` is a compiler marker comment that marks a JSX expression as static.
1616

1717
## Syntax
1818

@@ -23,8 +23,9 @@ description: >-
2323
## Behavior
2424

2525
- `/*@once*/` applies to the expression that follows it.
26-
- It tells the compiler not to wrap that expression in reactive access machinery.
26+
- Marked expressions are compiled as static and do not update when reactive dependencies change.
2727
- It can be used in props and in children.
28+
- Some compiler transforms, including parts of `classList` and `style` handling, do not fully respect `/*@once*/`.
2829

2930
## Examples
3031

0 commit comments

Comments
 (0)