You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<ImportPathpath="import { DetachedScope } from 'cx/widgets';" />
16
+
17
+
<Notetype="info">
18
+
For most performance optimization scenarios, consider using [PrivateStore](/docs/concepts/private-store) instead, which is more commonly used and easier to work with.
19
+
</Note>
20
+
21
+
`DetachedScope` improves performance by detaching certain areas from the main render loop. Detached contents render in their own render loop and use a data declaration to specify which changes can flow in or out.
22
+
23
+
Use this for heavy components like grids, charts, or rich popups that might be negatively affected by other elements on the page.
24
+
25
+
<CodeExamplecode={DetachedScopeExampleCode}>
26
+
<DetachedScopeExampleclient:load />
27
+
</CodeExample>
28
+
29
+
## How It Works
30
+
31
+
1. The `bind` prop specifies the data paths this scope depends on
32
+
2. The scope renders independently from the rest of the page
33
+
3. Only changes to the bound data trigger re-renders inside the scope
34
+
4. Changes inside the scope don't trigger re-renders outside
35
+
36
+
## Configuration
37
+
38
+
| Property | Type | Description |
39
+
| -------- | ---- | ----------- |
40
+
|`bind`|`string \| array`| Binding path(s) to monitor for changes. Shorthand for `data`. |
41
+
|`data`|`object`| Data selector object. Children update only when this data changes. |
42
+
|`exclusive`|`string \| array`| Paths for exclusive data that only affects this scope. |
43
+
|`exclusiveData`|`object`| Exclusive data selector for data used only within this scope. |
44
+
|`name`|`string`| Name of the scope for debugging purposes. |
0 commit comments