Skip to content

Commit 2e9f8b4

Browse files
Use count() instead of signal() in api children example (#1227)
1 parent 5730e1b commit 2e9f8b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/reference/component-apis/children.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ If you instead call `resolved()`, you re-use the already resolved children.
3333
You also guarantee that the children are tracked in the current component, as opposed to another tracking scope such as another component.
3434

3535
In addition, the `children` helper "resolves" children by calling argumentless functions and flattening arrays of arrays into an array.
36-
For example, a child specified with JSX like `{signal() * 2}` gets wrapped into a getter function `() => count() * 2` in `props.children`, but gets evaluated to an actual number in resolved, properly depending on a count signal.
36+
For example, a child specified with JSX like `{count() * 2}` gets wrapped into a getter function `() => count() * 2` in `props.children`, but gets evaluated to an actual number in resolved, properly depending on a count signal.
3737

3838
If the given `props.children` is not an array (which occurs when the JSX tag has a single child), then the `children` helper will not normalize it into an array.
3939
This is useful behavior e.g. when the intention is to pass a single function as a child, which can be detected via `typeof resolved() === 'function'`.

0 commit comments

Comments
 (0)