higher-order-components icon indicating copy to clipboard operation
higher-order-components copied to clipboard

Fix `withHoverProps` using `onMouseEnter` and `onMouseLeave`

Open deepsweet opened this issue 6 years ago • 1 comments

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).

deepsweet avatar Aug 21 '17 12:08 deepsweet

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.

CLAassistant avatar Jan 21 '21 10:01 CLAassistant