useClickAway

Detect if a click event happened outside an element.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

Click outside the green card to trigger the callback.

Preview
See code

0

APIs

useClickAway

const useClickAway = (
  ref: MutableRefObject<HTMLElement | null>,
  handler: (event: MouseEvent) => void,
) => void
Edit this page on GitHub

Previous

useClasses

Next

useClipboard

MADE & DESIGNED WITHBY BRUNO ANDRADE
docs background gradient blue
docs background gradient violet