Last active
May 4, 2020 02:44
-
-
Save AZagatti/ad7aeed1ea1afc4ef56ebb528f85aad3 to your computer and use it in GitHub Desktop.
State
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, { useState } from "react"; | |
import Person from "./components/Person"; | |
function App() { | |
const [name, setName] = useState(''); | |
return ( | |
<div> | |
<input type="text" value={name} onChange={e => setName(e.target.value)} /> | |
<Person name={name} /> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment