Skip to content

Lizhooh/react-hooks-use-hover

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-hooks-use-hover

react hook like css hover.

Note: This is using the new React Hooks API Proposal which is subject to change until React 16.7 final. You'll need to install react, react-dom, etc at ^16.7.0-alpha.0

Install

npm install react-hooks-use-hover
npm install react@^16.7.0-alpha.0 react-dom@^16.7.0-alpha.0

Usage

import React from 'react';
import useHover from 'react-hooks-use-hover';

function App() {
    const [hoverRef, isHovered] = useHover();

    return (
        <div ref={hoverRef}>
            {isHovered ? '😁' : '☹️'}
        </div>
    );
}

About

react hook like css hover.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published