useOrientation

Read the orientation of the screen, portrait or landscape, and its angle.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Rotate the device to see the values change.

APIs

useOrientation

const useOrientation = (defaultValue?: {
  angle: number
  type: OrientationType
}) => { angle: number; type: OrientationType }
Edit this page on GitHub