Skip to content

Commit

Permalink
fix type error
Browse files Browse the repository at this point in the history
  • Loading branch information
rayane-djouah committed Feb 8, 2024
1 parent 1dd0407 commit ec99856
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useResponsiveLayout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import navigationRef from '@libs/Navigation/navigationRef';
import {navigationRef} from '@libs/Navigation/Navigation';
import NAVIGATORS from '@src/NAVIGATORS';
import useWindowDimensions from './useWindowDimensions';

Expand All @@ -12,7 +12,7 @@ type ResponsiveLayoutResult = {
*/
export default function useResponsiveLayout(): ResponsiveLayoutResult {
const {isSmallScreenWidth} = useWindowDimensions();
const state = navigationRef?.getRootState();
const state = navigationRef?.current?.getRootState?.();
const lastRoute = state?.routes?.at(-1);
const lastRouteName = lastRoute?.name;
const isInModal = lastRouteName === NAVIGATORS.LEFT_MODAL_NAVIGATOR || lastRouteName === NAVIGATORS.RIGHT_MODAL_NAVIGATOR;
Expand Down

0 comments on commit ec99856

Please sign in to comment.