CodeWithHarry / NewsMonkey-React

News App created using React and NewsAPI
268 stars 205 forks source link

Adding the feature of back to top when all articles ends #4

Open prateek1656 opened 2 years ago

prateek1656 commented 2 years ago

handleBackTop = async ()=>{ this.setState({page: 1, articles: []}); this.updateArticle(); }

<InfiniteScroll dataLength={this.state.articles.length} next={this.fetchData} hasMore={this.state.articles.length !== this.state.totalResults} loader={} endMessage={ <p style={{ textAlign: "center" }}> Yay! You have seen it all

}

Bivishan1 commented 1 year ago

bro, does infinite scrolling is working fine on your class base component?

prateek1656 commented 1 year ago

Yes bro

Bivishan1 commented 1 year ago

Yes bro

Yes bro

can you please share your that code on github? cause mine is not working.

prateek1656 commented 1 year ago

Go to my GitHub profile, there would be a open repo named inews

Bivishan1 commented 1 year ago

i need class based component one but that was your functional based component.