@threlte/theatre

<Declare>

Sometimes we want our declarations to be closer to the place where we use them.

Use the component <Declare> to from the <SheetObject> slot prop to colocate an object and its properties with manual property declaration.

<SheetObject>
  {#snippet children({ Declare })}
    <Declare props={{ transparent: false }}>
      {#snippet children({ values })}
        <T.MeshBasicMaterial transparent={values.transparent} />
      {/snippet}
    </Declare>
  {/snippet}
</SheetObject>

This can also be used to pass the prop declaration API to child components using a slot prop.

Component Signature

Props

name
type
required

props
UnknownShorthandCompoundProps
yes