Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
expo-keep-awake
Advanced tools
Provides a React component that prevents the screen sleeping when rendered. It also exposes static methods to control the behavior imperatively.
The expo-keep-awake package is used to prevent the screen from sleeping or dimming while your app is in use. This is particularly useful for applications that require constant user interaction or display information that the user needs to see without interruption.
Activate Keep Awake
This feature allows you to activate the keep-awake functionality, preventing the screen from sleeping or dimming.
import { activateKeepAwake } from 'expo-keep-awake';
activateKeepAwake();
Deactivate Keep Awake
This feature allows you to deactivate the keep-awake functionality, allowing the screen to sleep or dim as usual.
import { deactivateKeepAwake } from 'expo-keep-awake';
deactivateKeepAwake();
Use Keep Awake Hook
This feature provides a React hook that you can use within a functional component to keep the screen awake while the component is mounted.
import { useKeepAwake } from 'expo-keep-awake';
function MyComponent() {
useKeepAwake();
return <View>{/* Your component code */}</View>;
}
The react-native-keep-awake package provides similar functionality to expo-keep-awake, allowing you to prevent the screen from sleeping. It is a good alternative for non-Expo managed workflows.
The react-native-idle-timer package allows you to enable or disable the idle timer, which controls whether the screen should sleep. It offers more granular control over the idle state compared to expo-keep-awake.
Provides a React component that prevents the screen sleeping when rendered. It also exposes static methods to control the behavior imperatively.
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.
For bare React Native projects, you must ensure that you have installed and configured the expo
package before continuing.
npx expo install expo-keep-awake
No additional set up necessary.
Run npx pod-install
after installing the npm package.
Contributions are very welcome! Please refer to guidelines described in the contributing guide.
FAQs
Provides a React component that prevents the screen sleeping when rendered. It also exposes static methods to control the behavior imperatively.
The npm package expo-keep-awake receives a total of 647,953 weekly downloads. As such, expo-keep-awake popularity was classified as popular.
We found that expo-keep-awake demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 28 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.