From 64cba3d3168fcdd971ac25fee11baf068053dc62 Mon Sep 17 00:00:00 2001 From: DDDDD12138 <43703884+DDDDD12138@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:41:21 +0800 Subject: [PATCH] docs(list): remove unexpected message on initial data load (#51687) --- components/list/demo/virtual-list.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/list/demo/virtual-list.tsx b/components/list/demo/virtual-list.tsx index d81465c024..a4fd604d1f 100644 --- a/components/list/demo/virtual-list.tsx +++ b/components/list/demo/virtual-list.tsx @@ -25,17 +25,17 @@ const ContainerHeight = 400; const App: React.FC = () => { const [data, setData] = useState([]); - const appendData = () => { + const appendData = (showMessage = true) => { fetch(fakeDataUrl) .then((res) => res.json()) .then((body) => { setData(data.concat(body.results)); - message.success(`${body.results.length} more items loaded!`); + showMessage && message.success(`${body.results.length} more items loaded!`); }); }; useEffect(() => { - appendData(); + appendData(false); }, []); const onScroll = (e: React.UIEvent) => {