Skip to content

next: add API for Canvas' plugin-props #74

@bigmistqke

Description

@bigmistqke

Currently we have the following API for adding/overwriting props:

const T = createT(THREE, [xrEvents()])
return <T.Mesh onXRSelect={...} />

return <Entity from={...} plugins={[xrEvents()]} />

But this only sets props to the objects in the scene.
There is currently no API for setting Canvas plugin-props.

For the xr-events plugin (see #65) it would be handy if we could add additional props to the <Canvas/> component too.

Idea for API on the consuming side:

const [T, Canvas] = createT.withCanvas(THREE, [xrEvents()])
return (
  <Canvas onXRSelect={...} >
    <T.Mesh onXRSelect={...} />
  </Canvas>
)

Not sure yet how the authoring should look like, specifically the question if you want to add a prop only to Canvas, how do you filter for it as there is no corresponding three.js class?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions