Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 599 Bytes

README.md

File metadata and controls

29 lines (20 loc) · 599 Bytes

⚛️ useLifoClickOutside()

npm-version

📡 Detect clicks outside of elements and close components in reverse order.

Installation

npm i use-lifo-click-outside

Usage

import { useLifoClickOutside } from 'use-lifo-click-outside';

useLifoClickOutside(ref, onClose);

<Portal>
  <Modal ref={ref}>
    ...
  </Modal>
</Portal>