Tracks screen orientation using orientationchange event.
import {OrientationSensor} from 'libreact/lib/OrientationSensor';
<OrientationSensor>(state) =>
<pre>{JSON.stringify(state, null, 4)}</pre>
</OrientationSensor>None.
Has signature
interface IOrientationSensorState {
angle: number;
type: string;
}, where
angle- screen rotation angle in degrees.type- is one ofportrait-primary,portrait-secondary,landscape-primary, orlandscape-secondary.
HOC that merges orientation prop into enhanced component's props.
import {withOrientation} from 'libreact/lib/OrientationSensor';React stateful component decorator that adds orientation prop.
import {withOrientation} from 'libreact/lib/OrientationSensor';
@withOrientation
class MyComp extends Component {
}