React Components

Components are independent and reusable bits of code.

React Components

Components are like functions that return HTML elements.

Ideally, different parts of a webpage (like the navbar, sidebar, content) are split into separate components.

Components come in two types, Class components and Function components.

Example

function Car() {
  return <h2>Hi, I am a Car!</h2>;
}