Created
October 8, 2020 10:04
-
-
Save chetanraj/2a99c8824e7ab37864119a843090ba56 to your computer and use it in GitHub Desktop.
../pages/Create/index.js
This file contains 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
import React from 'react'; | |
import { useName } from '../logics/useName'; | |
const Create = () => { | |
const { name, setName } = useName(); | |
const onChange = e => { | |
setName(e.target.value); | |
}; | |
return ( | |
<div> | |
<span>{name}</span> | |
<input onChange={e => onChange(e)} value={name} /> | |
</div> | |
); | |
}; | |
export { Create }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment