react-screen-wake-lock alternatives and similar libraries
Based on the "Utilities" category.
Alternatively, view react-screen-wake-lock alternatives based on common mentions on social networks and blogs.
-
react-on-rails
Integration of React + Webpack + Rails + rails/webpacker including server-side rendering of React, enabling a better developer experience and faster client performance. -
react-unity-webgl
React Unity WebGL provides a modern solution for embedding Unity WebGL builds in your React Application while providing advanced APIs for two way communication and interaction between Unity and React. -
<qr-code>
A no-framework, no-dependencies, customizable, animate-able, SVG-based <qr-code> HTML element. -
react-stripe-checkout
Load stripe's checkout.js as a react component. Easiest way to use checkout with React. -
backbone-react-component
A bit of nifty glue that automatically plugs your Backbone models and collections into your React components, on the browser and server -
react-fetching-library
Simple and powerful API client for react π Use hooks or FACCs to fetch data in easy way. No dependencies! Just react under the hood. -
react-translate-component
A component for React that utilizes the Counterpart module to provide multi-lingual/localized text content. -
react-children-utilities
Extended utils for βοΈ React.Children data structure that adds recursive filter, map and more methods to iterate nested children. -
gl-react
DISCONTINUED. OpenGL / WebGL bindings for React to implement complex effects over images and content, in the descriptive VDOM paradigm. -
state-in-url
Store any user state in query parameters; imagine JSON in a browser URL, while keeping types and structure of data. Dead simple, fast, and with static Typescript validation. Deep links, aka URL synchronization, made easy. -
gl-react-dom
WebGL bindings for React to implement complex effects over images and content, in the descriptive VDOM paradigm -
elm-react-component
DISCONTINUED. A React component which wraps an Elm module to be used in a React application. -
Redux Slim Async
:alien: A Redux middleware to ease the pain of tracking the status of an async action -
react-slack-notification
React Slack Notification is a lightweight package, Send messages to a Slack channel directly from your react app.
CodeRabbit: AI Code Reviews for Developers

* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of react-screen-wake-lock or a related project?
README
π react-screen-wake-lock Tiniest React implementation of the Screen Wake Lock API. It provides a way to prevent devices from dimming or locking the screen when an application needs to keep running.
Demo Β· Documentation Β· Twitter Created by Joris
Features
- π Follows the W3C Screen Wake Lock API specifications
- πͺ Easy to use - Just one react hook
useWakeLock
- πͺΆ Lightweight & 0 Dependency - Less than 650b
- π Easily integration - It works without additional configuration (React, remix, Next.js...)
- π§ͺ Ready to test - Mocks the Screen Wake Lock with Jest
- β οΈ Browser Support - Screen Wake Lock API
react-screen-wake-lock use native Screen Wake Lock API under the hood which is not supported by all browsers.
Examples (Demo)
Installation
yarn add react-screen-wake-lock
or
npm i react-screen-wake-lock
Usage
import { useWakeLock } from 'react-screen-wake-lock';
function Component() {
const { isSupported, released, request, release } = useWakeLock({
onRequest: () => alert('Screen Wake Lock: requested!'),
onError: () => alert('An error happened π₯'),
onRelease: () => alert('Screen Wake Lock: released!'),
});
return (
<div>
<p>
Screen Wake Lock API supported: <b>{`${isSupported}`}</b>
<br />
Released: <b>{`${released}`}</b>
</p>
<button
type="button"
onClick={() => (released === false ? release() : request())}
>
{released === false ? 'Release' : 'Request'}
</button>
</div>
);
}
export default Component;
Props
Prop | description | default | required |
---|---|---|---|
onRequest |
called on successfully navigator.wakeLock.request |
undefined |
false |
onError |
called when caught an error from navigator.wakeLock.request |
undefined |
false |
onRelease |
called when wake lock is released | undefined |
false |
Returns
Prop | description | type | |
---|---|---|---|
isSupported |
Browser support for the Screen Wake Lock API | boolean | |
released |
Once WakeLock is released, released become true and the value never changes again |
boolean | undefined |
request |
Returns a promise which allows control over screen dimming and locking | function | |
release |
Returns a promise that is resolved once the sentinel has been successfully released | function |
Testing
To write tests with ease, follow this guide