There are two ways to implement state and lifecycle into a component. We can convert the component into a Class component or we can use Hooks within the existing function component. I feel that it is very important for you to understand how to do this both ways. Class components are the original and old way of doing this. Hooks are the new cool way of implementing state. There are no plans to remove classes from React. So you are going to run across both Class and Function based, stateful components.

#react #react-native #reactjs #react hooks

React State and Lifecycle Explained Class/Hooks
1.60 GEEK