import React from 'react'; import InfiniteScroll from '../index'; type State = { data: number[]; }; export default class WindowInfiniteScrollComponent extends React.Component< {}, State > { state = { data: new Array(100).fill(1), }; next = () => { setTimeout(() => { const newData = [...this.state.data, new Array(100).fill(1)]; this.setState({ data: newData }); }, 2000); }; render() { return ( <> Loading...} dataLength={this.state.data.length} > {this.state.data.map((_, i) => (
#{i + 1} row
))}
); } }