Skip to content

Latest commit

 

History

78 Commits

Folders and files

Repository files navigation

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

react-native-gifted-chat

Before

react-native-gifted-chat

Installation

npm i @pnthach95/react-native-root-view-background --save

or

yarn add @pnthach95/react-native-root-view-background

Note

From v2, old arch is not supported

Note

New arch supported since v1.4.8

If latest version doesn't work, try v1.4.3

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

License

MIT


Made with create-react-native-library

About

Set background color of root view for react native

Topics

Resources

Code of conduct

Contributing

Stars

57 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages