From 79d8dc107aaadf4923024f8b122c0b55e1079706 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Tue, 31 Jan 2023 13:14:07 +0100 Subject: [PATCH] fix: don't modify browser history on re-render --- packages/native/src/useLinking.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/native/src/useLinking.tsx b/packages/native/src/useLinking.tsx index ef43f74c7e..8598cb1697 100644 --- a/packages/native/src/useLinking.tsx +++ b/packages/native/src/useLinking.tsx @@ -412,7 +412,7 @@ export default function useLinking( // This could happen since `history.go(n)` is asynchronous // If `pushState` or `replaceState` were called before `history.go(n)` completes, it'll mess stuff up return ref.current?.addListener('state', series(onStateChange)); - }); + }, [enabled, history, ref]); return { getInitialState,