Created
October 8, 2020 10:05
-
-
Save chetanraj/888724325bf97c1ec6d6ef7e26bdd6ac to your computer and use it in GitHub Desktop.
../logics/useName.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, { useState } from 'react'; | |
const useName = () => { | |
const [name, setValue] = useState(''); | |
const setName = name => { | |
setValue(name); | |
}; | |
return { name, setName }; | |
}; | |
export { useName }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment