Skip to content

Instantly share code, notes, and snippets.

@davidcostadev
Created January 18, 2020 21:32
Show Gist options
  • Save davidcostadev/6334e28e8bf863ac843bf069de5d127c to your computer and use it in GitHub Desktop.
Save davidcostadev/6334e28e8bf863ac843bf069de5d127c to your computer and use it in GitHub Desktop.
// hook/useName.js
import { useEffect, useState } from 'react';
const useName = () => {
const [name, setName] = useState('');
useEffect(() => {
setName('asdasdas')
}, [])
return [name, setName]
}
export { useName }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment