WhitestormJS / react-whs

WhitestormJS React integration ⚛

Home Page:https://whsjs.readme.io/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add ability to get component instance from react

sasha240100 opened this issue · comments

Currently, there is no way to get component object from react jsx structure. That means that we need to implement something like ref property, but for a component.

Now each component has refComponent property.

Usage:

<BasicSphere key="3"
  position={[0, 6, 0]}
  refComponent={component => {
    component.material.color.setRGB(1, 1, 0); // Set yellow
  }}
/>