react-no-sleep
v1.0.2
Published
headless component to keep browser awake
Downloads
19
Readme
react-no-sleep
headless component to keep browser awake
Install
npm install --save react-no-sleep
Usage
import * as React from 'react';
import ReactNoSleep from 'react-no-sleep';
class Example extends React.Component {
render() {
return (
<ReactNoSleep>
{({ isOn, enable, disable }) => (
<button onClick={isOn ? disable : enable}>
{isOn ? 'on' : 'off'}
</button>
)}
</ReactNoSleep>
);
}
}
License
MIT © malcolm-kee