Components in react

Components are the building blocks of a React application. They let you split the UI into independent, reusable pieces. Each component can accept inputs called props and return React elements describing what should appear on the screen. Components can be either function components (standard) or class components (legacy).

Example

function Greeting({ name }) {
  return <h1>Hello, {name}!</h1>;
}

// Usage
<Greeting name="Rahul" />

This function component accepts a 'name' prop and renders a greeting message.