20.
What is a component in React?
An independent and reusable piece of code.
An HTML element.
A CSS class.
A JavaScript object.
Correct: A
In React, a component is a reusable piece of code that defines the structure and behavior of a specific part of a user interface. Components can be either class-based or functional. Functional components are typically written as functions that return JSX (JavaScript syntax extension). They allow you to encapsulate UI logic and render dynamic content based on the data they receive as input. Components are the building blocks of React applications, and they can be composed together to create complex UI structures.