natelindev / react-use-hoverintent

React custom hook for hoverIntent
https://www.npmjs.com/package/react-use-hoverintent
MIT License
26 stars 4 forks source link

useHoverIntent return wrong array methods #38

Closed kurdin closed 2 years ago

kurdin commented 2 years ago

Your hook is not working if you follow the documentation. In your source code you return [isHovering, setIsHovering, intentRef] from useHoverIntent hook but in the doc, it says [isHovering, ref]. ref is not working correctly because it's setIsHovering method.

tony commented 2 years ago

const [isHovering, setIsHovering, intentRef] did the trick for me (as of 1.2.8)

This package is really nice, nice job @natelindev!

kurdin commented 2 years ago

const [isHovering, setIsHovering, intentRef] did the trick for me (as of 1.2.8)

This package is really nice, nice job @natelindev!

Yes it does work good with const [isHovering, setIsHovering, intentRef] I wanted to point that docs need to be updated as well.

Indeed nice package @natelindev

natelindev commented 2 years ago

Sorry for not updating the docs and introducing (potentially)breaking change with incorrect version change. I'll create a new version that fix these issues.

natelindev commented 2 years ago

fixed in v1.2.9