Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#06: Custom Hooks #7

Open
wants to merge 14 commits into
base: 02
Choose a base branch
from
Open

#06: Custom Hooks #7

wants to merge 14 commits into from

Conversation

ohansemmanuel
Copy link
Owner

@ohansemmanuel ohansemmanuel commented Oct 24, 2019

What is this PR about? 🤔

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

Changes 🎁

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

Before/After 📸

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

Other comments 💬

NA

@ohansemmanuel ohansemmanuel changed the base branch from 05 to 02 January 24, 2020 05:42
@@ -1,81 +1,81 @@
/* Clap button */
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore white space changes in this file :)

ohansemmanuel pushed a commit that referenced this pull request Jan 28, 2020
ohansemmanuel pushed a commit that referenced this pull request Jan 28, 2020
ohansemmanuel pushed a commit that referenced this pull request Jan 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant