1.3.3 • Published 7 years ago

react-native-orient v1.3.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Install

npm install --save react-native-orient

Usage

import { makeResponsive, getDimensions } from 'react-native-orient'

export class PortraitLockedComponent extends React.Component {
  static orientation = 'portrait';
  render() {
    const dim = getDimensions(PortraitLockedComponent)
    return (
      // ...
    )
  }
}

class ResponsiveComponent extends React.Component {
  render() {
    // will rerender when orientation / dimensions change
    // this.props = {
    //   .. 
    //   orientation: 'portrait', // or 'landscape'
    //   dimensions: { width, height }
    // }
    const dim = this.props.dimensions
    return (
      // ...
    )
  }
}

ResponsiveComponent = makeResponsive(ResponsiveComponent)
export ResponsiveComponent
1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.0

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago