The current Demo component for the useClickOutside hook does not increment the counter when clicking outside the target element.
The issue appears to be caused by not properly destructuring the ref returned by useClickOutside:
const clickOutsideRef = useClickOutside<HTMLDivElement>(() => { ... });
According to the documentation ref should be destructured like this:
const { ref } = useClickOutside<HTMLDivElement>(() => { ... });
The current Demo component for the useClickOutside hook does not increment the counter when clicking outside the target element.
The issue appears to be caused by not properly destructuring the ref returned by useClickOutside:
According to the documentation
refshould be destructured like this: