Pomax / react-onclickoutside

An onClickOutside wrapper for React components
MIT License
1.82k stars 187 forks source link

Functional Component with UseState Hook #339

Open 0rsa opened 4 years ago

0rsa commented 4 years ago

It doesn't work if you use component multiple times.

Try author example: https://codesandbox.io/s/vn66kq7mml

Duplicate <Menu />

Run jsfiddle, handleClickOutside is only triggered for the last component added.

0rsa commented 4 years ago

Dupplicate of https://github.com/Pomax/react-onclickoutside/issues/329

I switched to react-cool-onclickoutside whichs works fine using hooks.