diff --git a/src/components/Link.tsx b/src/components/Link.tsx index 421a7fe9d6..2b533b5998 100644 --- a/src/components/Link.tsx +++ b/src/components/Link.tsx @@ -165,8 +165,8 @@ export function useLink({ if (isNative && screen !== 'NotFound') { const state = navigation.getState() // if screen is not in the current navigator, it means it's - // most likely a tab screen - if (!state.routeNames.includes(screen)) { + // most likely a tab screen. note: state can be undefined + if (!state?.routeNames.includes(screen)) { const parent = navigation.getParent() if ( parent &&