Exit to Dashboard
25% complete

Your First React Component

15 minutes

Your First React Component

React components are the building blocks of React applications.

Creating a Component

jsx
function Welcome() {
return <h1>Hello, World!</h1>;
}

Key Concepts

  • JSX - JavaScript XML syntax

  • Props - Pass data to components

  • Export - Make components reusable
  • Example with Props

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

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

    Practice creating your own components!

    Next Lesson