weasel API - v0.8.0
    Preparing search index...

    Function useScene

    • React hook returning a kit-owned Scene. The Scene is constructed once per host component and tracked via useSyncExternalStore, so React re- renders on every Scene mutation (including undo/redo).

      Two call shapes:

      • Trivial: useScene({ items }) — one auto-registered system layer named 'default', each item added as a leaf with pose === data === item. Cheapest path for "a flat list of rects."
      • Full: useScene({ systemLayers, initial?, ops?, ... }) — explicit layers, parenting, and custom op registration.

      Type Parameters

      • TItem extends { id: string }

      Parameters

      Returns Scene<TItem, "default", TItem>

    • React hook returning a kit-owned Scene. The Scene is constructed once per host component and tracked via useSyncExternalStore, so React re- renders on every Scene mutation (including undo/redo).

      Two call shapes:

      • Trivial: useScene({ items }) — one auto-registered system layer named 'default', each item added as a leaf with pose === data === item. Cheapest path for "a flat list of rects."
      • Full: useScene({ systemLayers, initial?, ops?, ... }) — explicit layers, parenting, and custom op registration.

      Type Parameters

      • TData
      • TLayer extends string
      • TPose = RectPose

      Parameters

      Returns Scene<TData, TLayer, TPose>