Skip to content

Instantly share code, notes, and snippets.

@AZagatti
Last active May 4, 2020 02:44
Show Gist options
  • Save AZagatti/ad7aeed1ea1afc4ef56ebb528f85aad3 to your computer and use it in GitHub Desktop.
Save AZagatti/ad7aeed1ea1afc4ef56ebb528f85aad3 to your computer and use it in GitHub Desktop.
State
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