DEV Community

Discussion on: Futuristic Infinite Scrolling in React and JavaScript

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 :)