···21212222## Usage
23232424+There are three different ways you can use this library to keep a screen from going to sleep
24252525-```js
2626-import { multiply } from 'react-native-keep-awake';
2626+### Add a Component
2727+2828+Any screen that includes the `KeepAwake` component in its tree will not go to sleep.
27292828-// ...
3030+```tsx
3131+import { KeepAwake } from 'react-native-keep-awake';
29323030-const result = multiply(3, 7);
3333+function MyScreen() {
3434+ return (
3535+ <View>
3636+ <KeepAwake />
3737+ <Text>This screen won't go to sleep!</Text>
3838+ </View>
3939+ )
4040+}
3141```
32424343+### Use a Hook
4444+4545+Invoking the `useKeepAwake` hook will prevent that screen from going to sleep.
4646+4747+```tsx
4848+import { useKeepAwake } from 'react-native-keep-awake';
4949+5050+function MyScreen() {
5151+ useKeepAwake()
5252+ return (
5353+ <View>
5454+ <Text>This screen won't go to sleep!</Text>
5555+ </View>
5656+ )
5757+}
5858+```
5959+6060+### Manual Control
6161+6262+```tsx
6363+import { activate, deactivate } from 'react-native-keep-awake';
6464+6565+function MyScreen() {
6666+ return (
6767+ <View>
6868+ <Text>Press this button to block the screen from going to sleep</Text>
6969+ <Button title="Activate" onPress={activate} />
7070+7171+ <Text>Press this button to allow the screen to sleep/lock</Text>
7272+ <Button title="Deactivate" onPress={deactivate} />
7373+ </View>
7474+ )
7575+}
7676+```
33773478## Contributing
3579