Permalink
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (24 sloc) 709 Bytes

<LightSensor>

Ues AmbientLightSensor API to privide lightning data.

Usage

import {LightSensor} from 'libreact/lib/LightSensor';

<LightSensor>{(light) =>
  JSON.stringify(light, null, 4)
}</LightSensor>

withLight() HOC

Higher order component that injects illumination prop into your component.

import {withLight} from 'libreact/lib/LightSensor';

const MyCompWithLight = withLight(MyComp);

@withLight HOC

Class decorator that injects illumination prop into your component.

import {withLight} from 'libreact/lib/LightSensor';

@withLight
class MyComp extends Component {

}