File tree Expand file tree Collapse file tree
src/routes/reference/jsx-attributes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 - optimization
1010version : " 1.0"
1111description : >-
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
You can’t perform that action at this time.
0 commit comments