Skip to main content

These utilities manage solid-three's per-instance metadata. Metadata lives on the three.js instance itself under a non-enumerable symbol key ($S3C) — there is no external WeakMap. Each entry stores the entity's solid-three props, its scene-graph parent, and its set of children.

  • meta(instance, augmentation?): Attaches solid-three metadata to instance (idempotent — re-applying is a no-op). augmentation defaults to { props: {} }; pass a { props } object (commonly with a getter) when you want the entity's props to be reactive. Returns the same instance, narrowed to Meta<T>.
  • getMeta(object): Returns the metadata Data<T> attached to object, or undefined if no metadata is present.
  • hasMeta(object): Type guard — returns true (narrowing to Meta<T>) when the object carries solid-three metadata.
  • $S3C: The Symbol key used to store metadata on instances. Exposed for advanced introspection (e.g. directly reading instance[$S3C] in custom integrations); prefer getMeta/hasMeta in normal code.
import { getMeta, hasMeta, meta, $S3C } from "solid-three"
// Check if an object has solid-three metadata
if (hasMeta(mesh)) {
const metadata = getMeta(mesh)
console.log(metadata.props, metadata.parent, metadata.children)
}
// Attach metadata to a raw three.js instance (e.g. when integrating an existing object)
const tagged = meta(new Mesh(), { props: {} })
// The symbol key, for direct access in advanced cases
tagged[$S3C] // same shape as getMeta(tagged)

See also

  • useThree — its gl, scene, and camera are all Meta-tagged and can be inspected with getMeta.

Last updated: 6/8/26, 11:20 AM

solid threeA SolidJS renderer for three.js — learn by reading.
Community
github