[]previous and next page

ForUnkeyedProps

Props of For without key: rows are matched by item reference.

Props of For without key: rows are matched by item reference.

Import#

ts
import type { ForUnkeyedProps } from "@shadow-js/web";

Signature#

ts
interface ForUnkeyedProps<T> {
  /**
   * The list to render. `null`, `undefined` and `false` count as an empty list. Read lazily, inside
   * the list memo, so it is tracked.
   */
  readonly each: readonly T[] | null | undefined | false;
  /**
   * Shown while the list is empty. Read lazily.
   * @default undefined (an empty list renders nothing)
   */
  readonly fallback?: unknown;
  /**
   * Absent in this form: rows are matched by item reference. Pass `key` to match by key.
   * No default: omit it for reference matching.
   */
  readonly key?: undefined;
  /** Called once per row, untracked. The callback receives the item value. */
  readonly children: (item: T, index: () => number) => unknown;
}

Members#

Name Type Description
T T
each readonly each: readonly T[] | null | undefined | false The list to render. null, undefined and false count as an empty list. Read lazily, inside the list memo, so it is tracked.
fallback? readonly fallback?: unknown Shown while the list is empty. Read lazily.
key? readonly key?: undefined Absent in this form: rows are matched by item reference. Pass key to match by key. No default: omit it for reference matching.
children readonly children: (item: T, index: () => number) => unknown Called once per row, untracked. The callback receives the item value.