From cbb56760c62397cdc719bb81a52558bec8d11779 Mon Sep 17 00:00:00 2001 From: Vincent Fretin Date: Sat, 16 Aug 2025 10:27:57 +0200 Subject: [PATCH] Use count() instead of signal() in api children example, we talk about count() later in the sentence --- src/routes/reference/component-apis/children.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/reference/component-apis/children.mdx b/src/routes/reference/component-apis/children.mdx index 2d001fb0c..bf90388d6 100644 --- a/src/routes/reference/component-apis/children.mdx +++ b/src/routes/reference/component-apis/children.mdx @@ -33,7 +33,7 @@ If you instead call `resolved()`, you re-use the already resolved children. You also guarantee that the children are tracked in the current component, as opposed to another tracking scope such as another component. In addition, the `children` helper "resolves" children by calling argumentless functions and flattening arrays of arrays into an array. -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. +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. 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. 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'`.