HoverableContainer
Extends React.Component
A container that has a mouseEnter and mouseLeave event handler.
Parameters
-
props
object-
props.onMouseEnter
function The function to invoke when the mouse enters the container. -
props.onMouseLeave
function The function to invoke when the mouse leaves the container. -
props.onMouseEnterDelay
number? The number of milliseconds to wait before invoking onMouseEnter. -
props.onMouseLeaveDelay
number? The number of milliseconds to wait before invoking onMouseLeave. -
props.containerStyle
object? Extra css styles to apply to the container. -
props.delay
number The number of milliseconds to wait for both mouse events. (optional, default300
)
-
Examples
import { HoverableContainer } from
"@alexseitsinger/react-hoverable-container"
const App = ({ onMouseEnter, onMouseLeave, ... }) => {
return (
<HoverableContainer
onMouseEnter={onMouseEnter}
onMouseLeave={onMouseLeave}>
<div>Some other content</div>
</HoverableContainer>
)
}
Returns function A component