0.0.2 • Published 4 years ago
@redoute/with-mouse-states v0.0.2
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.
0.0.2
4 years ago