Created
February 7, 2020 13:24
-
-
Save erikdubbelboer/e6062c6bca538f255e63870188bf287f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const App = () => { | |
const [value, setValue] = useState(// ...get initial value here | |
const onChange = event => setValue(event.target.value); | |
useEffect(// ...update localStorage here | |
return ( | |
<div> | |
<input value={value} type='text' onChange={onChange} /> | |
<p>{value}</p> | |
</div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment