rn-custom-style-sheet
Version:
React Native component to select a specific value from a range of values.
11 lines (9 loc) • 407 B
text/typescript
import type { ThemeContextType } from '../../Context';
import { OrientationEnum } from '../../Reducer';
import { useThemeContext } from '../UseThemeContext';
export default function useCurrentOrientation(): OrientationEnum {
const {
state: { orientation, isSupportedOrientation },
}: ThemeContextType = useThemeContext();
return isSupportedOrientation ? orientation : OrientationEnum.Portrait;
}