Skip to content

Simple React Native Provider component that forces a re-render when orientation changes.

License

Notifications You must be signed in to change notification settings

kristerkari/react-native-orientation-change-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native Orientation Change Provider

Simple React Native Provider component that forces a re-render when orientation changes.

Installation

npm install react-native-orientation-change-provider --save-dev

or

yarn add react-native-orientation-change-provider --dev

Usage

Import OrientationChangeProvider and wrap your whole app with the provider:

import { OrientationChangeProvider } from "react-native-orientation-change-provider";

...

<OrientationChangeProvider>
  <App />
</OrientationChangeProvider>;

Notice that using OrientationChangeProvider will force your app to re-render when the orientation changes. It causes all this.state from child components to reset. You can work around that by using a global state, for example Redux.

About

Simple React Native Provider component that forces a re-render when orientation changes.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published