Created
March 19, 2019 17:47
-
-
Save antoinejaussoin/72578570720295d5f7c009cdd3313e80 to your computer and use it in GitHub Desktop.
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
// ✅ This is covered by Jooks. | |
// It is a function starting by "use" and using basic hooks internally. | |
const useMyHook = () => { | |
const [first, setFirst] = useState('alpha'); | |
const update = () => { | |
setFirst(first + 'a'); | |
}; | |
return { first, update }; | |
}; | |
// 🚫 This is NOT covered by Jooks. | |
// This is a component that is using a basic hook, not a custom hook. | |
const MyComponent = () => { | |
const [first, setFirst] = useState('alpha'); | |
return ( | |
<div>{first}</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment