From 932b29e66f5babd0faa8b7dabc97f4833b0ca8f5 Mon Sep 17 00:00:00 2001 From: wonfen Date: Mon, 17 Feb 2025 16:27:06 +0800 Subject: [PATCH] fix: Refine TypeScript types for proxy groups component --- src/components/proxy/proxy-groups.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/proxy/proxy-groups.tsx b/src/components/proxy/proxy-groups.tsx index 15741f96..ec8f2aa0 100644 --- a/src/components/proxy/proxy-groups.tsx +++ b/src/components/proxy/proxy-groups.tsx @@ -129,7 +129,7 @@ export const ProxyGroups = (props: Props) => { const virtuosoRef = useRef(null); const scrollPositionRef = useRef>({}); const [showScrollTop, setShowScrollTop] = useState(false); - const scrollerRef = useRef(null); + const scrollerRef = useRef(null); // 使用useMemo缓存字母索引数据 const { groupFirstLetters, letterIndexMap } = useMemo(() => { @@ -346,7 +346,7 @@ export const ProxyGroups = (props: Props) => { overscan={150} defaultItemHeight={56} scrollerRef={(ref) => { - scrollerRef.current = ref; + scrollerRef.current = ref as Element; }} components={{ Footer: () =>
, @@ -384,7 +384,7 @@ function debounce any>( func: T, wait: number, ): (...args: Parameters) => void { - let timeout: NodeJS.Timeout | null = null; + let timeout: ReturnType | null = null; return (...args: Parameters) => { if (timeout) clearTimeout(timeout); timeout = setTimeout(() => func(...args), wait);