File tree Expand file tree Collapse file tree
src/libs/Navigation/AppNavigator/createSearchFullscreenNavigator/useCustomState Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ import type {CustomStateHookProps} from '@libs/Navigation/PlatformStackNavigatio
22import SCREENS from '@src/SCREENS' ;
33
44/**
5- * This is a custom state hook that is used to render the last two search routes in the stack.
5+ * This is a custom state hook for SearchFullscreenNavigator that is used to render the last two search routes in the stack.
66 * For native platforms, we render the last two routes to allow users to return by swiping left.
7+ * @see SearchFullscreenNavigator use only!
78 */
89export default function useCustomState ( { state} : CustomStateHookProps ) {
910 const lastSearchNavigatorIndex = state . routes . findLastIndex ( ( route ) => route . name === SCREENS . SEARCH . ROOT ) ;
Original file line number Diff line number Diff line change 11import type { CustomStateHookProps } from '@libs/Navigation/PlatformStackNavigation/types' ;
22
33/**
4- * This is a custom state hook that is used to render the last search route in the stack.
4+ * This is a custom state hook for SearchFullscreenNavigator that is used to render the last search route in the stack.
55 * We do this to improve the performance of the search results screen by avoiding unnecessary re-renders of underneath routes.
6+ * @see SearchFullscreenNavigator use only!
67 */
78export default function useCustomState ( { state} : CustomStateHookProps ) {
89 const routesToRender = state . routes . slice ( - 1 ) ;
You can’t perform that action at this time.
0 commit comments