Using props in JSX
📖 Scenario: You are building a simple React app that shows a greeting message for different users. Each greeting should show the user's name inside a friendly message.
🎯 Goal: Build a React functional component called Greeting that uses props to display a personalized message with the user's name.
📋 What You'll Learn
Create a functional component named
Greeting that accepts props.Use
props.name inside JSX to show the user's name.Render the
Greeting component with the name "Alice".Render the
Greeting component with the name "Bob".💡 Why This Matters
🌍 Real World
Using props in JSX is how React apps show dynamic data like user names, messages, or product info.
💼 Career
Understanding props is essential for React developers to build reusable and flexible UI components.
Progress0 / 4 steps