Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 709 Bytes

LightSensor.md

File metadata and controls

39 lines (24 loc) · 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 {

}