DEV Community

Cover image for class and functional component in react
Gobinath Varatharajan
Gobinath Varatharajan

Posted on

class and functional component in react

The project help to understand the concept of useState, map and ternary operator in function component and using same functionality in class company

why more developer switch from class to hooks?
how to use them effectively by building a carousel?

LooK below

I have a list of images like

const sampleImages = [
  "https://images.pexels.com/photos/3836292/pexels-photo-3836292.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500",
  "https://images.pexels.com/photos/2792157/pexels-photo-2792157.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500",
  "https://images.pexels.com/photos/1166209/pexels-photo-1166209.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500",
  "https://images.pexels.com/photos/1661179/pexels-photo-1661179.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500",
  "https://images.pexels.com/photos/45201/kitty-cat-kitten-pet-45201.jpeg?auto=compress&cs=tinysrgb&dpr=2&w=500"
];
Enter fullscreen mode Exit fullscreen mode

I have made the application both on hooks and class.check and work with them. I a welcome with feedback.

Top comments (0)