Skip to content

Instantly share code, notes, and snippets.

@batuhansahan
Created March 14, 2020 22:05
Show Gist options
  • Save batuhansahan/b38e404a9cb88598764882c965b4bc3d to your computer and use it in GitHub Desktop.
Save batuhansahan/b38e404a9cb88598764882c965b4bc3d to your computer and use it in GitHub Desktop.
hooks4.js
import React, {useState} from 'react'
export default function App(props){
const [name, setName] = useState('Reactish')
function handleNameChange(e){
setName(e.target.value)
}
return (
<div>
<div>Name:</div>
<input
value={name}
onChange={handleNameChange}
/>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment