Skip to content

Instantly share code, notes, and snippets.

@antoinejaussoin
Created March 19, 2019 17:47
Show Gist options
  • Save antoinejaussoin/72578570720295d5f7c009cdd3313e80 to your computer and use it in GitHub Desktop.
Save antoinejaussoin/72578570720295d5f7c009cdd3313e80 to your computer and use it in GitHub Desktop.
// ✅ 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