supermedium / aframe-react

:atom: Build virtual reality experiences with A-Frame and React.
https://ngokevin.github.io/aframe-react-boilerplate/
MIT License
1.42k stars 151 forks source link

Enable composability while using components. #1

Closed ngokevin closed 8 years ago

ngokevin commented 8 years ago

Would like to be able to create something like:

<Light type="directional"/>

while still being able to mix in arbitrary components:

<Light type="directional" geometry="primitive: sphere" material={sphereColor}/>

Can do this by having a React component that detects a main schema and expanding the properties of the schema onto the main component, and then applying the rest of the components as attributes.

<a-entity light="{lightSchemaProperties}" {...otherComponents}>
ngokevin commented 8 years ago

Not going to recommend creating React components to alias one entity.