Skip to content

Commit 5fe71a5

Browse files
add usage remarks
1 parent c332e93 commit 5fe71a5

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/libs/Navigation/AppNavigator/createSearchFullscreenNavigator/useCustomState/index.native.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import type {CustomStateHookProps} from '@libs/Navigation/PlatformStackNavigatio
22
import 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
*/
89
export default function useCustomState({state}: CustomStateHookProps) {
910
const lastSearchNavigatorIndex = state.routes.findLastIndex((route) => route.name === SCREENS.SEARCH.ROOT);

src/libs/Navigation/AppNavigator/createSearchFullscreenNavigator/useCustomState/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import 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
*/
78
export default function useCustomState({state}: CustomStateHookProps) {
89
const routesToRender = state.routes.slice(-1);

0 commit comments

Comments
 (0)