Closed JperF closed 7 years ago
I have the following code in my react native component. The screen brightness is not persisting. The screen brightness stays on for approximately 1-2 seconds then returns to the original brightness.
(e, state, context) => { console.log(state); if (!state.index) { DeviceBrightness.getBrightnessLevel() .then((luminous) => { this.setState({ luminous }, () => { DeviceBrightness.setBrightnessLevel(1); }); }); } else { DeviceBrightness.setBrightnessLevel(this.state.luminous); } }
I have the following code in my react native component. The screen brightness is not persisting. The screen brightness stays on for approximately 1-2 seconds then returns to the original brightness.