Skip to content

Commit 11d08af

Browse files
Merge branch 'main' into patch-1
2 parents e0744c3 + 150d4e3 commit 11d08af

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/routes/reference/reactive-utilities/untrack.mdx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,12 @@ description: >-
1919
Ignores tracking any of the dependencies in the executing code block and returns the value. This helper is useful when a certain `prop` will never update and thus it is ok to use it outside of the tracking scope.
2020

2121
```tsx title="component.tsx"
22-
import { untrack } from "solid-js"
22+
import { untrack } from "solid-js";
2323

2424
export function Component(props) {
25-
const value = untrack(() => props.value)
25+
const value = untrack(() => props.value);
2626

27-
return <div>{value}</div>
28-
}
27+
return <div>{value}</div>;
2928
}
3029
```
3130

@@ -35,24 +34,22 @@ It is not necessary to manually untrack values that are suppose to serve as a de
3534

3635
```tsx tab title="initialValue" {5}
3736
// component.tsx
38-
import { createSignal } from "solid-js"
37+
import { createSignal } from "solid-js";
3938

4039
export function Component(props) {
41-
const [name, setName] = createSignal(props.initialName)
40+
const [name, setName] = createSignal(props.initialName);
4241

43-
return <div>{name()}</div>
44-
}
42+
return <div>{name()}</div>;
4543
}
4644
```
4745

4846
```tsx tab title="defaultValue" {5}
4947
// component.tsx
50-
import { createSignal } from "solid-js"
48+
import { createSignal } from "solid-js";
5149

5250
export function Component(props) {
53-
const [name, setName] = createSignal(props.defaultName)
51+
const [name, setName] = createSignal(props.defaultName);
5452

55-
return <div>{name()}</div>
56-
}
53+
return <div>{name()}</div>;
5754
}
5855
```

0 commit comments

Comments
 (0)