Something went wrong. Try again.
Prevent the phone screen from going to sleep.
Something went wrong. Try again.
401 B · 22 lines
TSX
at main
1234567891011121314151617181920212223import NativeKeepAwake from './NativeKeepAwake';import { useEffect } from 'react';
export function activate(): void { NativeKeepAwake.activate();}
export function deactivate(): void { NativeKeepAwake.deactivate();}
export function useKeepAwake(): void { useEffect(() => { activate(); return deactivate; }, []);}
export function KeepAwake() { useKeepAwake(); return null;}