HoverObserver 📌

A React component that notifies its children of hover interactions.

Initial code taken from: https://github.com/ethanselzer/react-hover-observer.

System Component 📌

This component is shipped with BlueBase Core.

Usage

<HoverObserver>
 {({ isHovering }) => (
         <YourChildComponent isActive={isHovering} />
 )}
</HoverObserver>

isHovering is always false on Android or iOS.

Properties

prop

type

required

default

description

hoverDelayInMs

number

no

0

Milliseconds to delay hover trigger.

hoverOffDelayInMs

number

no

0

Milliseconds to delay hover-off trigger.

onHoverChanged

(HoverObserverState) => void

no

-

Called with named argument isHovering when isHovering is set or unset.

onMouseEnter

Function

no

-

Defaults to set isHovering.

onMouseLeave

Function

no

-

Defaults to unsetting isHovering.

onMouseOver

Function

no

-

onMouseOut

Function

no

-

children

ReactNode | (HoverObserverState) => ReactNode

no

-

testID

string

no

-

Used to locate this view in end-to-end tests.

Last updated