0.1.0 • Published 6 years ago
@alexseitsinger/react-hoverable-container v0.1.0
HoverableContainer
Extends React.Component
A container that has a mouseEnter and mouseLeave event handler.
Parameters
- propsobject- props.onMouseEnterfunction The function to invoke when the mouse enters the container.
- props.onMouseLeavefunction The function to invoke when the mouse leaves the container.
- props.onMouseEnterDelaynumber? The number of milliseconds to wait before invoking onMouseEnter.
- props.onMouseLeaveDelaynumber? The number of milliseconds to wait before invoking onMouseLeave.
- props.containerStyleobject? Extra css styles to apply to the container.
- props.delaynumber The number of milliseconds to wait for both mouse events. (optional, default- 300)
 
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
0.1.0
6 years ago