Creating React Components

Learn about the React components and how to use them.

What is a component?

Components allow us to separate the user interface into pieces that can be reused and handled independently. They perform the same function as JavaScript but work independently and return HTML. Components are classified into two types–class components and functional components.

React extensions are required for class components–ES6 classes that return JSX. Before the introduction of React Hooks, it was impossible to use state inside functional components (in earlier versions of React, such as 16.8); functional components were only used for rendering UI.

Thanks to React Hooks, we can now use states in functional components, and many developers use them because of their clearer syntax. We’ll also be using functional components in this course.

Get hands-on with 1200+ tech skills courses.