gutsyDev
gutsyDev

Reputation: 1

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.

Upvotes: 0

Views: 209

Answers (0)

Related Questions