@ce1pers/use-screen

1.0.3 • Public • Published

@ce1pers/use-screen

React native hook to control device orientation.

Installation

npm

npm i @ce1pers/use-screen

yarn

yarn add @ce1pers/use-screen

Usage

// Import hook.
import {
  addListener,
  getCurrentScreenOrientation,
  releaseOrientation,
  removeListener,
  setOrientationByLandscape,
  setOrientationByPortrait,
} from "@ce1pers/use-screen";

...

const App = () => {
  useEffect(async () => {
    // Set device orientation by landscape.
    await setOrientationByLandscape();
  }, []);

  return (
    <Container>
      <View>
        <Text>App Screen</Text>
      </View>
    </Container>
  );
};

export default App;

...

Package Sidebar

Install

npm i @ce1pers/use-screen

Weekly Downloads

3

Version

1.0.3

License

MIT

Unpacked Size

4.59 kB

Total Files

4

Last publish

Collaborators

  • __coma__