From the course: Build Modern Web Apps with React, Hooks, State Management, and APIs Using Vite or Next.js

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Components: Functional and class

Components: Functional and class

Hi and welcome to lesson number 2. In this lesson, we are going to discuss about components. As you have seen in the previous videos, we created a component. We are going to deep dive into components now. Components are the basic building blocks of a react application. Actually, a react application comprises of multiple components. Components allows us to encapsulate logic plus user interface of an independent business function. It gives us the advantage to have reusability in our application. We can create as many components as we want and we can use them in multiple places by reusing them. Consider a welcome component or a splash screen component which greets the user. What if you want to put the user in multiple places in your application? Rather than writing down the of that greeting component everywhere on your screen, you just have to create a component for this and reuse that component in multiple places as you want. We did one kind of similar example where we broken down the…

Contents