DEV Community

loading...

Discussion on: Hooks in React

myogeshchavan97 profile image
Yogesh Chavan

Thanks. With the addition of React Hooks, there is now no difference between class components and functional components.

You can do everything in the functional component that the class components offered.

The only difference between them is that there are no available hooks for getSnapshotBeforeUpdate, getDerivedStateFromError and componentDidCatch lifecycle method of class components.

So If you need to use these lifecycle methods, you need to use class components instead of functional components