Services Work Learn About Contact
0/10
Lesson 2 of 10

JSX & Components

JSX is a syntax extension that looks like HTML inside JavaScript. It makes React code easier to read and write. A component is a function that returns JSX. Components are reusable building blocks.

Component names must start with a capital letter. You can nest components inside other components.

REACT
// A simple component
function Welcome() {
  return <h2>Welcome to my app!</h2>;
}

// Using the component inside another
function App() {
  return (
    <div>
      <h1>My Website</h1>
      <Welcome />
      <Welcome />
    </div>
  );
}
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed React!

You finished all 10 lessons and quizzes. You now know the basics of React.