Created
May 17, 2020 18:03
-
-
Save jsmanifest/216bf8a6f0fa0f68a07e59728b8972b1 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 }) { | |
console.log(`current state value: ${value}`) | |
console.log(`incoming value: ${e.target.value}`) | |
setValue(e.target.value) | |
console.log(`current state value now: ${value}`) | |
} | |
function onChange2(e) { | |
e.concat(['abc', {}, 500]) | |
} | |
function onChange3(e) { | |
console.log(e.target.value) | |
} | |
return ( | |
<div> | |
<MyInput | |
value={value} | |
onChange={onChange} | |
onChange2={onChange2} | |
onChange3={onChange3} | |
/> | |
</div> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment