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
Copy file name to clipboardExpand all lines: src/routes/reference/reactive-utilities/get-owner.mdx
+12-8Lines changed: 12 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@ type Owner = unknown;
30
30
function getOwner():Owner|null;
31
31
```
32
32
33
-
The concrete owner shape is internal and is primarily useful with[`runWithOwner`](/reference/reactive-utilities/run-with-owner).
33
+
The `Owner` interface is public, but its concrete shape is mostly useful for advanced interop such as[`runWithOwner`](/reference/reactive-utilities/run-with-owner).
34
34
35
35
## Parameters
36
36
@@ -47,25 +47,29 @@ Returns the current owner or `null` when no owner is active.
47
47
-`getOwner` returns the current owner and does not create or modify ownership.
48
48
- Owners determine cleanup and context lookup for descendant computations.
49
49
- A computation created inside the current scope becomes part of the current owner tree unless ownership is overridden.
50
-
-Components are not computations and do not create owner nodes themselves.
50
+
-Component functions run under an owner created for that subtree.
51
51
- Calling `getOwner` inside component code returns the owner responsible for rendering and disposing that component subtree.
52
52
- Turning off tracking with [`untrack`](/reference/reactive-utilities/untrack) does not create a new owner.
Copy file name to clipboardExpand all lines: src/routes/reference/reactive-utilities/run-with-owner.mdx
+15-14Lines changed: 15 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,32 +58,33 @@ Returns the value produced by `fn`, or `undefined` when an error is routed throu
58
58
59
59
- During the synchronous execution of `fn`, `runWithOwner` restores the provided owner for cleanup, context lookup, and descendant computations created inside `fn`.
60
60
-`runWithOwner` does not restore dependency tracking because the current tracking listener is cleared while `fn` runs.
61
-
- Code after the first `await` in an `async` function runs without reactive dependency tracking.
61
+
- Code after the first `await` in an `async` function runs without the restored owner or reactive dependency tracking.
Copy file name to clipboardExpand all lines: src/routes/reference/reactive-utilities/start-transition.mdx
+23-6Lines changed: 23 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,7 +46,8 @@ Resolves when the transition completes.
46
46
47
47
## Behavior
48
48
49
-
- Updates scheduled inside `fn` run as a transition. Nested calls inside an active transition reuse that transition and return its existing promise, which resolves after transition work completes.
49
+
- On the client, `fn` runs asynchronously in a microtask and its updates run as a transition.
50
+
- Nested calls inside an active transition reuse that transition and return its existing promise, which resolves after transition work completes.
50
51
- On the server, `startTransition(fn)` runs `fn()` synchronously.
51
52
-`startTransition` is the transition-starting function exposed by [`useTransition`](/reference/reactive-utilities/use-transition), without the `pending` accessor.
52
53
@@ -55,18 +56,34 @@ Resolves when the transition completes.
Copy file name to clipboardExpand all lines: src/routes/reference/reactive-utilities/untrack.mdx
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,19 +48,24 @@ Returns the value produced by `fn` unchanged.
48
48
## Behavior
49
49
50
50
-`untrack` only affects reads inside the provided function. Signals read there do not become dependencies of the surrounding computation.
51
-
-On the server, `untrack`runs through the server runtime's `batch` implementation.
51
+
-`untrack`does not create or restore an owner.
52
52
53
53
## Examples
54
54
55
-
### Read a prop without tracking
55
+
### Read part of an effect without tracking
56
56
57
57
```tsx
58
-
import { untrack } from"solid-js";
58
+
import { createEffect, untrack } from"solid-js";
59
59
60
60
exportfunction Component(props) {
61
-
const value =untrack(() =>props.value);
61
+
createEffect(() => {
62
+
console.log(
63
+
props.id,
64
+
untrack(() =>props.label)
65
+
);
66
+
});
62
67
63
-
return <div>{value}</div>;
68
+
return <div>{props.id}</div>;
64
69
}
65
70
```
66
71
@@ -86,8 +91,7 @@ function Example() {
86
91
87
92
## Notes
88
93
89
-
Default and initial prop values can be read directly when initializing a signal.
90
-
This pattern commonly appears with names such as `initialName` and `defaultName`.
94
+
Default and initial prop values can be read directly when initializing a signal. This pattern commonly appears with names such as `initialName` and `defaultName`.
0 commit comments