Socket
Book a DemoInstallSign in
Socket

@react-hook/hover

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@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`.

Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
3.6K
-20.93%
Maintainers
1
Weekly downloads
 
Created
Source

@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>
  )
}

Keywords

react

FAQs

Package last updated on 03 Apr 2019

Did you know?

Socket

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.

Install

Related posts