@pnthach95/react-native-root-view-background
v1.4.8
Published
Set root view background color for Android and iOS
Downloads
6,642
Readme
React Native Root View Background
Original: https://github.com/johniak/react-native-root-view-background
Remake to support React Native latest version.
Set background color of root view to fix white flash when using dark theme and navigating with React Navigation. Read more in example
.
After
Before
Installation
npm i @pnthach95/react-native-root-view-background --save
or
yarn add @pnthach95/react-native-root-view-background
[!NOTE] It's not compatible with RN 0.76 yet. PR welcome. If latest version doesn't work, install v1.4.3 (newer versions are failed efforts to make it work in RN 0.76)
Usage
import { setRootViewBackgroundColor } from '@pnthach95/react-native-root-view-background';
const Main = () => {
useEffect(() => {
setRootViewBackgroundColor('#ccc');
}, []);
}
For Expo users:
They have SystemUI which is similar to this package
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT
Made with create-react-native-library