From 014114d77fa4b6ce469b1a8ab43c7793ed899129 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Tue, 4 Jul 2023 16:55:28 +0100 Subject: [PATCH] Use the variable from hook rather then props --- src/libs/Navigation/NavigationRoot.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/Navigation/NavigationRoot.js b/src/libs/Navigation/NavigationRoot.js index 3f8662f6690e..23c320eb991c 100644 --- a/src/libs/Navigation/NavigationRoot.js +++ b/src/libs/Navigation/NavigationRoot.js @@ -55,6 +55,9 @@ function NavigationRoot(props) { const navigationStateRef = useRef(undefined); const firstRenderRef = useRef(true); + const {updateCurrentReportID} = useCurrentReportID(); + const {isSmallScreenWidth} = useWindowDimensions(); + useEffect(() => { if (firstRenderRef.current) { // we don't want to make the report back button go back to LHN if the user @@ -63,14 +66,11 @@ function NavigationRoot(props) { firstRenderRef.current = false; return; } - if (!props.isSmallScreenWidth) { + if (!isSmallScreenWidth) { return; } Navigation.setShouldPopAllStateOnUP(); - }, [props.isSmallScreenWidth]); - - const {updateCurrentReportID} = useCurrentReportID(); - const {isSmallScreenWidth} = useWindowDimensions(); + }, [isSmallScreenWidth]); const prevStatusBarBackgroundColor = useRef(themeColors.appBG); const statusBarBackgroundColor = useRef(themeColors.appBG);