Last active
March 16, 2023 23:00
-
-
Save D-Maher/ee0fc65d44b355b9ee7bdd566bd6012e to your computer and use it in GitHub Desktop.
React component with props
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
function UserGreeting({ name, age }) { | |
return ( | |
<p> | |
Hello, my name is {name} and I am {age} years old. | |
</p> | |
); | |
} | |
function App() { | |
return ( | |
<div> | |
<UserGreeting name="John" age={30} /> | |
<UserGreeting name="Jane" age={25} /> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment