Ues AmbientLightSensor
API
to privide lightning data.
import {LightSensor} from 'libreact/lib/LightSensor';
<LightSensor>{(light) =>
JSON.stringify(light, null, 4)
}</LightSensor>
Higher order component that injects illumination
prop into your component.
import {withLight} from 'libreact/lib/LightSensor';
const MyCompWithLight = withLight(MyComp);
Class decorator that injects illumination
prop into your component.
import {withLight} from 'libreact/lib/LightSensor';
@withLight
class MyComp extends Component {
}