-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Currently this will fail:
return <Canvas scene={{ background: [1, 0, 0] }} />`- When encountering an array, the prop handling will try to
target[propName].set(...propValue) - Because
Scene.backgroundis null initialized, there is nothing to.setto
The current solution is to pass a THREE.Color instead:
return <Canvas scene={{ background: new Color(1, 0, 0) }} />`But maybe there could be a way to declare
- if
prop[key]exists 👉prop[key].set(...values) - if
prop[key]exists 👉prop[key] = new Constructor(...values)
Proposal
Maybe something like:
<Canvas scene={{ background: setOrInit(Color, [1, 0, 0]) }} />a bit in the vein of https://github.com/tc39/proposal-upsert ?
Metadata
Metadata
Assignees
Labels
No labels