Skip to content

Example of useHover's handleClose function #2802

Closed Answered by atomiks
section14 asked this question in React
Discussion options

You must be logged in to vote

Yeah although it technically works, the assumption is that handleClose is only to be used with safePolygon right now due to the __options; but here's how to use it:

function createHandler(context) {
  return function onMouseMove(event) {
    // ...
  }
}
// This is an implementation detail, and _should_ be optional
createHandler.__options = { blockPointerEvents: false };
useHover(context, {
  handleClose: createHandler
});

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by section14
Comment options

You must be logged in to vote
2 replies
@atomiks
Comment options

@silverwind
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
React
Labels
None yet
3 participants