Prevents Android and/or iOS device from going to sleep. Comes in a few React.js flavors
Prevents devices from going to sleep due to inactivity. Useful for apps in which users watch the app without interaction, e.g. video or audio apps, games, exercise tools etc.
expo-keep-awake.$ npm install --save react-native-no-sleepjavascript
import { useNoSleep } from 'react-native-no-sleep';const GameScreen = () => {
useNoSleep();
return (
I don't sleep while mounted
);
};
`$3
`javascript
import { NoSleep } from 'react-native-no-sleep';const GameScreen = () => (
return (
I don't sleep while mounted
);
};
``