From 1aef030d7561a492e9f2e57e4814e1ac542e6991 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Fri, 21 Oct 2022 15:29:02 -0300 Subject: [PATCH] Chore: Deprecate Dimensions (#4597) --- app/dimensions.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/dimensions.tsx b/app/dimensions.tsx index afa86d38b..cd45a1f9d 100644 --- a/app/dimensions.tsx +++ b/app/dimensions.tsx @@ -26,6 +26,9 @@ export const DimensionsContext = React.createContext( Dimensions.get('window') as IDimensionsContextProps ); +/** + * @deprecated use RN's useWindowDimensions hook instead + */ export function withDimensions(Component: React.ComponentType & TNavigationOptions): typeof Component { const DimensionsComponent = (props: T) => ( {contexts => } @@ -35,8 +38,14 @@ export function withDimensions(Component: React.ComponentType< return DimensionsComponent; } +/** + * @deprecated use RN's useWindowDimensions hook instead + */ export const useDimensions = () => React.useContext(DimensionsContext); +/** + * @deprecated use RN's useWindowDimensions hook instead + */ export const useOrientation = () => { const { width, height } = React.useContext(DimensionsContext); const isPortrait = height > width;