Skip to content

Commit e32e310

Browse files
committed
docs: improve MediaDevice docs
1 parent 7e0011a commit e32e310

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

docs/MediaDeviceSensor.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,34 @@ user's connected media devices.
66
## Usage
77

88
```jsx
9-
import {MediaDevicesSensor} from 'libreact/lib/MediaDevicesSensor';
9+
import {MediaDeviceSensor} from 'libreact/lib/MediaDeviceSensor';
1010

11-
<MediaDevicesSensor>{(state) =>
11+
<MediaDeviceSensor>{(state) =>
1212
JSON.stringify(state, null, 4)
1313
}</MediaDevicesSensor>
1414
```
15+
16+
17+
## `withMediaDevices()`
18+
19+
Higher order component that injects `devices` prop into your component.
20+
21+
```js
22+
import {withMediaDevices} from 'libreact/lib/MediaDeviceSensor';
23+
24+
const MyCompDevices = withMediaDevices(MyComp);
25+
```
26+
27+
28+
## `@withMediaDevices`
29+
30+
Statefull component class decorator that injects `devices` prop into your component.
31+
32+
```js
33+
import {withMediaDevices} from 'libreact/lib/MediaDeviceSensor';
34+
35+
@withMediaDevices
36+
class MyComp extends Component {
37+
38+
}
39+
```

0 commit comments

Comments
 (0)