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

Fix withHoverProps using onMouseEnter and onMouseLeave#52

Open
deepsweet wants to merge 1 commit intomasterfrom
bugfix/hover
Open

Fix withHoverProps using onMouseEnter and onMouseLeave#52
deepsweet wants to merge 1 commit intomasterfrom
bugfix/hover

Conversation

@deepsweet
Copy link
Copy Markdown
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".
@deepsweet deepsweet requested a review from xaviervia August 21, 2017 12:32
@CLAassistant
Copy link
Copy Markdown

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