From a3208fb7262ab6723cf06a89c9b5627e2586bdaa Mon Sep 17 00:00:00 2001 From: besscroft Date: Tue, 30 Jul 2024 23:19:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=80=91=E5=B8=83?= =?UTF-8?q?=E6=B5=81=E6=B8=B2=E6=9F=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Masonry.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/components/Masonry.tsx b/components/Masonry.tsx index 5ceacf0..d9399b3 100644 --- a/components/Masonry.tsx +++ b/components/Masonry.tsx @@ -15,6 +15,16 @@ import { FloatButton } from 'antd' import 'react-photo-album/masonry.css' +function renderNextImage( + { alt = '', title, sizes }: RenderImageProps, + { photo }: RenderImageContext, + dataList: never[], +) { + return ( + + ); +} + export default function Masonry(props : Readonly) { const { data: pageTotal } = useSWRPageTotalHook(props) const { data, error, isLoading, isValidating, size, setSize } = useSWRInfinite((index) => { @@ -34,15 +44,6 @@ export default function Masonry(props : Readonly) { (state) => state, ) - function renderNextImage( - { alt = '', title, sizes }: RenderImageProps, - { photo }: RenderImageContext, - ) { - return ( - - ); - } - useEffect(() => { const fetchData = async (id: number) => { try { @@ -84,7 +85,7 @@ export default function Masonry(props : Readonly) { ...item })) || [] } - render={{ image: renderNextImage }} + render={{image: (...args) => renderNextImage(...args, dataList)}} />
{