What are props
📖 Scenario: You want to create a simple React component that shows a greeting message. The message should come from outside the component so you can reuse it with different greetings.
🎯 Goal: Build a React component that receives a greeting message as a prop and displays it inside a paragraph.
📋 What You'll Learn
Create a functional React component named
GreetingUse a
prop named message to pass the greeting textRender the
message inside a <p> elementUse the
Greeting component inside App and pass the message 'Hello, friend!'💡 Why This Matters
🌍 Real World
Props let you build flexible UI parts that change based on data, like showing user names or messages.
💼 Career
Understanding props is essential for React developers to create reusable and maintainable components.
Progress0 / 4 steps