Просмотр исходного кода

fix: initialize search keyword on mount in PrivateLegacyPages component

Shun Miyazawa 4 месяцев назад
Родитель
Сommit
80d617c428

+ 5 - 0
apps/app/src/features/search/client/components/PrivateLegacyPages.tsx

@@ -281,6 +281,11 @@ const PrivateLegacyPages = (): JSX.Element => {
     (ISelectableAll & IReturnSelectedPageIds) | null
   >(null);
 
+  // biome-ignore lint/correctness/useExhaustiveDependencies: only run on mount
+  useEffect(() => {
+    setSearchKeyword(initQ);
+  }, [])
+
   const { data, conditions, mutate } = useSWRxSearch(
     keyword,
     'PrivateLegacyPages',