JSPM

react-native-orientation-change-provider

0.11.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q32819F
  • License MIT

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

Package Exports

  • react-native-orientation-change-provider

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-orientation-change-provider) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.