Created
May 17, 2020 18:02
-
-
Save jsmanifest/27afaa96da7a10172e79e8fea2c6b3cf 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
function App() { | |
const [value, setValue] = React.useState('') | |
function onChange(e, { ref }) { | |
// ERROR --> e is actually the { ref } object so e.target is undefined | |
setValue(e.target.value) | |
} | |
return ( | |
<div> | |
<MyInput value={value} onChange={onChange} /> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment