
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
react-interactions-observer
Advanced tools
A React component that notifies its children of interactions.
A React component that notifies its children of hover interactions.
Optionally observe mouseenter, mouseleave, mouseover, and mouseout events.
Supports delayed hover and hover-off, which can help reduce unintentional triggering.
Experiment with these editable examples on CodePen.
For mouse or touch position monitoring, please consider react-cursor-position.
npm install --save react-hover-observer
import ReactHoverObserver from 'react-hover-observer';
export default () => (
<ReactHoverObserver>
<YourChildComponent />
</ReactHoverObserver>
);
Each child component of ReactHoverObserver receives a Boolean prop named isHovering.
react-hover-observer wraps its children in a div, which is the boundary for triggering hover events.
Optionally implement the function as child component pattern. This is especially useful if your component has an incompatible interface with react-hover-observer.
export default () => (
<ReactHoverObserver>
{({ isHovering }) => (
<YourChildComponent isActive={isHovering} />
)}
</ReactHoverObserver>
);
className : String [optional] - A CSS class to be applied to the div rendered by react-hover-observer.
hoverDelayInMs : Number [optional] - Milliseconds to delay hover trigger. Defaults to zero. See the hoverDelayInMs example for more.
hoverOffDelayInMs : Number [optional] - Milliseconds to delay hover-off trigger. Defaults to zero.
onHoverChanged: Function [optional] - Called with named argument isHovering when isHovering is set or unset. See the onHoverChanged example for more.
shouldDecorateChildren : Boolean [optional] - Defaults to true. Optionally suppress decoration of child components by setting this prop false.
onMouseEnter : Function [optional] - Defaults to set isHovering.
onMouseLeave : Function [optional] - Defaults to unsetting isHovering.
onMouseOver : Function [optional] - See the onMouseOver example for more.
onMouseOut : Function [optional]
Each of the previous four observer functions receives a prameter of type Object with the following properties:
e : Object - The browser event object (React synthetic event).
setIsHovering : Function - Call this function to set isHovering to true.
unsetIsHovering : Function - Call this function to set isHovering to false.
onMouseOver and onMouseOut can be used to control hover state when child components are hovered. See the onMouseOver example for more.
onMouseEnter and onMouseLeave are not triggered by hover events bubbling up from child elements.
onMouseOver and onMouseOut are triggered by hover events bubbling up from child elements.
The behavior is determined by mouse event Web standards. See the docs at MDN for more.
Please open an issue.
git clone https://github.com/ethanselzer/react-hover-observer.git
cd react-hover-observer
yarn
See available commands:
npm run
Please contribute using Github Flow. Create a branch, add commits, and open a pull request.
MIT
FAQs
A React component that notifies its children of interactions.
The npm package react-interactions-observer receives a total of 1 weekly downloads. As such, react-interactions-observer popularity was classified as not popular.
We found that react-interactions-observer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.