From 1b0f813ae5708abbba06e808ddd48b82c45f4064 Mon Sep 17 00:00:00 2001 From: "thai.ly" Date: Mon, 16 Dec 2024 12:36:06 +0700 Subject: [PATCH] fix: add dependency highlights in function callback scrollToHighlightFromHash --- example/src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/src/App.tsx b/example/src/App.tsx index 2b4c32b75..61cf4dd09 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -74,7 +74,7 @@ export function App() { if (highlight) { scrollViewerTo.current(highlight); } - }, []); + }, [highlights]); useEffect(() => { window.addEventListener("hashchange", scrollToHighlightFromHash, false);