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

fix(hooks): Update useOnclickOutside file name and dependency array #105

Merged
merged 1 commit into from
Aug 26, 2021

Conversation

yasincaliskan
Copy link
Contributor

Description

  • onClickOutside and debounce hooks were renamed as useOnClickOutside and useDebounce.
  • callback was removed from the dependency array. Because callback reference changes on every render on component level. So useEffect works repeatedly every render. But in this version, the hook has two useEffect and element listeners just work when the element change.

@edizcelik edizcelik added the Ready for new release PR is reviewed and ready to be merged label Jul 16, 2021
@mucahit mucahit merged commit 66f98a8 into next-release Aug 26, 2021
@mucahit mucahit deleted the fix/update-use-on-click-outside-dependency branch August 26, 2021 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for new release PR is reviewed and ready to be merged ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants