Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
276 views
in Technique[技术] by (71.8m points)

javascript - Using infinite scroll for rendering and fetching more data using react

I wanted to add an infinite scroll component to one of my react components. I am using react-infinite-scroll-component and want to add fetch more after a certain length.

Here is the component and I want to make an Infinite scroll on new Items

let newItems = logs.filter(function(log){
        return log.completed === false
    })
    return (
        <div>
            <div>
            <h1>ALL</h1>
            {
                newItems.map((item)=>(
                    <Item key={item.id} logs={logs} />
                )  
                )
            }
        </div>
        </div>
        

The code snippet provided in react-infinite-scroll-component examples I want to achieve similar with 5 elements from newItems list.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...