DocsStylesComponentsPatternsExamples
Payroller

Wednesday, April 10th, 2024

Posted by Yongmin

useClickRectOutside

A hook to detect clicks outside of a ref.

It uses getBoundingClientRect to detect clicks outside of the ref. (not the element itself).

So it is useful when there is floating elements created by React Portals.