Skip to content

Commit bc691b9

Browse files
committed
fix: spread array correctly in story next()
The previous code pushed a nested array instead of spreading items, causing incorrect data shape in the Storybook window scroll story.
1 parent 53d7748 commit bc691b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/stories/WindowInfiniteScrollComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default class WindowInfiniteScrollComponent extends React.Component<
1313

1414
next = () => {
1515
setTimeout(() => {
16-
const newData = [...this.state.data, new Array(100).fill(1)];
16+
const newData = [...this.state.data, ...new Array(100).fill(1)];
1717
this.setState({ data: newData });
1818
}, 2000);
1919
};

0 commit comments

Comments
 (0)