What is a component in React and how is it defined?
A component in React is a fundamental piece of the user interface. It can be defined as a function or a class.
For example:
function MyComponent() {
return (
<div>
<h1>Hello, World!</h1>
</div>
);
}