0.0.2 • Published 4 years ago

@redoute/with-mouse-states v0.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

name: withMouseStates menu: HOC

route: /with-mouse-states

import { useState } from 'react' import { Playground, Props } from 'docz' import withMouseStates from '@redoute/with-mouse-states'

withMouseStates

The withMouseStates is a HOC. You can use it to add mouse states on a button. It's very useful if you can to change the aspect of an icon when hovered or active.

The WrappedComponent will get the props isHovered and isActive. Your component can also take a isDisabled props to prevent any the mouse event.