From a7b051d3f557c58a6a0a3df532b8b6a72f030052 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Tue, 28 Nov 2023 21:19:06 +0000 Subject: [PATCH] Fix memory leak on mobile web navigation --- src/view/com/util/Link.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/view/com/util/Link.tsx b/src/view/com/util/Link.tsx index 074ab23298..d25db237d5 100644 --- a/src/view/com/util/Link.tsx +++ b/src/view/com/util/Link.tsx @@ -12,11 +12,7 @@ import { TouchableWithoutFeedback, TouchableOpacity, } from 'react-native' -import { - useLinkProps, - useNavigation, - StackActions, -} from '@react-navigation/native' +import {useLinkProps, useNavigation} from '@react-navigation/native' import {Text} from './text/Text' import {TypographyVariant} from 'lib/ThemeContext' import {NavigationProp} from 'lib/routes/types' @@ -327,9 +323,8 @@ function onPressInner( Linking.openURL(href) } else { closeModal() // close any active modals - // @ts-ignore we're not able to type check on this one -prf - navigation.dispatch(StackActions.push(...router.matchPath(href))) + navigation.navigate(...router.matchPath(href)) } } }