taggit Summary
React gives us two ways of writing our components — functional components, and class components. Let’s take a look at the syntax of functional and class components — how to write each style of component, the different ways of using React state, and how to write lifecycle methods. Now, here’s the equivalent component as a class component. In a class component, the object is initialized in the , and can be used anywhere in the component using .