A component is a self-contained, reusable piece of code that returns HTML via JSX. Components allow you to break down the UI into manageable pieces, each with its logic. React has two main types of components: functional and class components.
function Greeting() {
return <h1>Hello, World!</h1>;
}