StepsEasy
React Props - Example
Run
Reset
Destroy & Close
← Back to lesson
Code Editor
javascript
// Function component with props function Welcome({ name, age }) { return ( <div className="card"> <h2>Welcome, {name}!</h2> <p>Age: {age}</p> </div> ); } // Using the component function App() { return ( <div> <Welcome name="Alice" age={25} /> <Welcome name="Bob" age={30} /> </div> ); }
Result
Click "Run" to execute the code...
Loading runtime...
Ready
JAVASCRIPT | In-Browser Execution