From 082562ce1128bdb3b50c782b66c06a9b7d876309 Mon Sep 17 00:00:00 2001 From: Balaji Saravanan Date: Wed, 18 Oct 2023 18:46:52 +0530 Subject: [PATCH] chore(story): fix window infinite scroll story Fix to set proper data on refetching new data. The array of 100 elements are pushed as a single element. Spreading it out to push 100 individual elements. --- src/stories/WindowInfiniteScrollComponent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stories/WindowInfiniteScrollComponent.tsx b/src/stories/WindowInfiniteScrollComponent.tsx index f41caf9..5aec3b1 100644 --- a/src/stories/WindowInfiniteScrollComponent.tsx +++ b/src/stories/WindowInfiniteScrollComponent.tsx @@ -13,7 +13,7 @@ export default class WindowInfiniteScrollComponent extends React.Component< next = () => { setTimeout(() => { - const newData = [...this.state.data, new Array(100).fill(1)]; + const newData = [...this.state.data, ...new Array(100).fill(1)]; this.setState({ data: newData }); }, 2000); };