DEV Community

Discussion on: Futuristic Infinite Scrolling in React and JavaScript

Collapse
dhairyanadapara profile image
Dhairya Nadapara Author • Edited on

Agree with you @vndre it been there for a long time. But people still doesn't know about this. I have searched for infinite scrolling react component on npm and haven't found any which is community maintained. Thanks for suggestion, I will try to improve quality of my sample code to be more realistic with api call. Thanks again :)

Collapse
vndre profile image
Andre

What about github.com/thebuilder/react-inters... ?

I believe a hook approach would make things easier.

Thread Thread
dhairyanadapara profile image
Dhairya Nadapara Author

Yes, I have seen the react-infinite-intersection but, I was confused because they have very few download on npm.

There are two reasons why I'm more inclined towards the class components:

  1. I'm more inclined towards the object oriented programming. So, I get more comfortable with class components and they are easy to understand for me
  2. Some times before I have to add some feature in a functional components and it was developed by someone in organization. At the beginning there was no issue but as the component complexity increases the issues were getting worse. It's easy to write but it's easy to make mistakes too.

For creating small components like UI framework with independent components or stateless components, I use functional components but for components which are going be complex with lots of features, I prefer class components.

Thanks :)