React Lifecycle Methods Diagram For Functional Component
Hooks are a new addition in React 16.8. They let you use state and other React features without writing a class.
If you are working with Class Component with some lifecycle functions like componentDidMount, componentDidUpdate, componentWillUnmount,...
So now, you can use React Hooks to migrate them inside functional components.
In some cases, we also need Class Component when we have to use the feature Error Boundary to catch errors when rendering UI.
Otherwise, React Hooks work well and are easy to read.
Below is the diagram to visualize what we will face when working with Functional Components.