From 603a3673ee21dda63e180927767b33f9ffa1b0d0 Mon Sep 17 00:00:00 2001 From: Alex Lohr Date: Wed, 16 Oct 2024 21:00:47 +0200 Subject: [PATCH] fix: unkeyed show argument (#922) --- src/routes/reference/components/show.mdx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/reference/components/show.mdx b/src/routes/reference/components/show.mdx index 4e0cbc696..f9a4da629 100644 --- a/src/routes/reference/components/show.mdx +++ b/src/routes/reference/components/show.mdx @@ -9,11 +9,11 @@ The Show control flow is used to conditional render part of the view: it renders import { Show } from "solid-js" import type { JSX } from "solid-js" -function Show(props: { +function Show(props: { when: T | undefined | null | false keyed: boolean fallback?: JSX.Element - children: JSX.Element | ((item: T) => JSX.Element) + children: JSX.Element | ((item: T | Accessor) => JSX.Element) }): () => JSX.Element ``` @@ -33,6 +33,8 @@ Show can also be used as a way of keying blocks to a specific data model. For ex ``` +If the `keyed` property is not used, the argument of a child function will be an accessor containing the item. + ## Props | Name | Type | Description |