react-native-orientation-locker icon indicating copy to clipboard operation
react-native-orientation-locker copied to clipboard

TypeError: undefined is not an object (evaluating '_reactNativeOrientationLocker.OrientationType.PORTRAIT')

Open wouterds opened this issue 2 years ago • 1 comments

Not sure what's up but I can't use the enum from import.

Using it like so

import { OrientationType, useOrientationChange } from 'react-native-orientation-locker';

...

const onOrientationChange = useCallback(orientation => {
  setIsVisible(orientation === OrientationType.PORTRAIT);
}, []);

useOrientationChange(onOrientationChange);

simulator_screenshot_0E6F4B61-E719-4ABE-AFF9-8D477EAF0F4C

wouterds avatar Sep 22 '21 07:09 wouterds

try to fixed: #203

NiuGuohui avatar Oct 12 '21 10:10 NiuGuohui