JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5297
  • Score
    100M100P100Q120659F
  • License MIT

Package Exports

  • @react-hook/hover

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@react-hook/hover) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@react-hook/hover

A React hook for tracking the hover state of DOM elements in browsers where hover is enabled. If the browser does not support hover states (e.g. a phone) the isHovering value will always be false.

Installation

yarn add @react-hook/hover

Usage

import useHover from '@react-hook/hover'

const F = props => {
  const [hoverRef, isHovering] = useHover(200/*enterDelay*/, 200/*leaveDelay*/)
  return (
    <div ref={hoverRef}>
      {isHovering ? 'Hovering' : 'Not hovering'}
    </div>
  )
}