Skip to content

Instantly share code, notes, and snippets.

@jsmanifest
Created May 17, 2020 18:00
Show Gist options
  • Save jsmanifest/1fe40211a595e00063eba9536747594f to your computer and use it in GitHub Desktop.
Save jsmanifest/1fe40211a595e00063eba9536747594f to your computer and use it in GitHub Desktop.
function App() {
const [value, setValue] = React.useState('')
function onChange(e) {
setValue(e.target.value)
}
return <MyInput value={value} onChange={onChange} />
}
function MyInput({ value, onChange }) {
return (
<div>
<input type='text' value={value} onChange={onChange} />
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment