From b918e474ef02622d417e2617157de64b0d14655d Mon Sep 17 00:00:00 2001 From: Maxim Karpov Date: Thu, 28 Mar 2024 13:10:08 +0300 Subject: [PATCH] feat: add language control selector for static build --- src/components/App/App.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/App/App.tsx b/src/components/App/App.tsx index 2fc5207..f6f3b35 100644 --- a/src/components/App/App.tsx +++ b/src/components/App/App.tsx @@ -120,9 +120,12 @@ export function App(props: DocInnerProps): ReactElement { const settings = useSettings(); const mobileView = useMobile(); - const onChangeLang = useCallback((lang: Lang) => { - window.location.replace(getLangPath(router, lang)); - }, []); + const onChangeLang = useCallback( + (lang: Lang) => { + window.location.replace(getLangPath(router, lang)); + }, + [router], + ); const {theme, textSize, wideFormat, fullScreen, showMiniToc, onChangeFullScreen} = settings; const fullHeader = !fullScreen && Boolean(navigation);