From 5b1a43f16b26c5764c8dd323447bb8489abe136f Mon Sep 17 00:00:00 2001 From: JimmFly Date: Fri, 23 Dec 2022 12:50:21 +0800 Subject: [PATCH] fix: eslint warning about quick search --- packages/app/src/components/quick-search/input.tsx | 2 +- packages/app/src/components/quick-search/results.tsx | 3 ++- packages/app/src/ui/empty/empty.tsx | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/app/src/components/quick-search/input.tsx b/packages/app/src/components/quick-search/input.tsx index e12bc523cc..8e68afc386 100644 --- a/packages/app/src/components/quick-search/input.tsx +++ b/packages/app/src/components/quick-search/input.tsx @@ -38,7 +38,7 @@ export const Input = (props: { { + onCompositionStart={() => { setIsComposition(true); }} onCompositionEnd={e => { diff --git a/packages/app/src/components/quick-search/results.tsx b/packages/app/src/components/quick-search/results.tsx index bd10cc335a..4838577270 100644 --- a/packages/app/src/components/quick-search/results.tsx +++ b/packages/app/src/components/quick-search/results.tsx @@ -31,7 +31,8 @@ export const Results = (props: { setResults(search(query)); setLoading(false); //Save the Map obtained from the search as state - }, [query, search, setLoading]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [query, setResults, setLoading]); const pageIds = [...results.values()]; const resultsPageMeta = pageMetaList.filter( diff --git a/packages/app/src/ui/empty/empty.tsx b/packages/app/src/ui/empty/empty.tsx index ec6cc1607b..156236da5d 100644 --- a/packages/app/src/ui/empty/empty.tsx +++ b/packages/app/src/ui/empty/empty.tsx @@ -1,4 +1,4 @@ -import React, { CSSProperties } from 'react'; +import { CSSProperties } from 'react'; import { EmptySVG } from './emptySVG'; import { styled } from '@/styles'; @@ -8,7 +8,7 @@ export type ContentProps = { fontSize?: CSSProperties['fontSize']; }; export const Empty = styled(EmptySVG)( - ({ theme, fontSize, width, height }) => { + ({ fontSize, width, height }) => { return { width, height,