Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

Fix withHoverProps using onMouseEnter and onMouseLeave #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deepsweet
Copy link
Contributor

Because onMouseOver and onMouseOut bubbles up to the DOM triggering unnecessary re-renders every time you hover on any children of wrapped with this HOC component. onMouseEnter and onMouseLeave stops this madness and works just like "hover".

See https://api.jquery.com/mouseenter/ and https://api.jquery.com/mouseleave/ for further details.

This is a breaking change because we need to change props mapping in every wrapped component (if it's not in {...props} ofc).

Because `onMouseOver` and `onMouseOut` bubbles up to the DOM triggering unnecessary re-renders every time you hover on any children of wrapped with this HOC component. `onMouseEnter` and `onMouseLeave` stops this madness and works just like "hover".
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants