Skip to content

Latest commit

 

History

History
39 lines (24 loc) · 791 Bytes

MediaDeviceSensor.md

File metadata and controls

39 lines (24 loc) · 791 Bytes

<MediaDeviceSensor>

Uses MediaDevices to track user's connected media devices.

Usage

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

<MediaDeviceSensor>{(state) =>
  JSON.stringify(state, null, 4)
}</MediaDeviceSensor>

withMediaDevices()

Higher order component that injects devices prop into your component.

import {withMediaDevices} from 'libreact/lib/MediaDeviceSensor';

const MyCompDevices = withMediaDevices(MyComp);

@withMediaDevices

Stateful component class decorator that injects devices prop into your component.

import {withMediaDevices} from 'libreact/lib/MediaDeviceSensor';

@withMediaDevices
class MyComp extends Component {

}