advanced-react-patterns-ultrasimplified icon indicating copy to clipboard operation
advanced-react-patterns-ultrasimplified copied to clipboard

#06: Custom Hooks

Open ohansemmanuel opened this issue 4 years ago • 0 comments

What is this PR about? 🤔

Break apart functionality from the component into smaller bits, reusable hooks.

Changes 🎁

  • [x] Created a useClapState hook to handle related state logic
  • [x] Created a useEffectAfterMount to handle side effects after mount
  • [x] Created a useDOMRef hook to save DOM refs via the data-attribute: refkey
  • [x] Animated a coffee cup with the hooks created

Before/After 📸

https://advanced-react-patterns-ultrasimplified.netlify.com/custom-hooks

Other comments 💬

NA

ohansemmanuel avatar Oct 24 '19 12:10 ohansemmanuel