Pomax / react-onclickoutside

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

Fix to accommodate arrow functions and their lack of a prototype. #334

Closed justnoah closed 1 year ago

justnoah commented 5 years ago

While trying to implement testing, I was getting the error:

After some diligent internet scouring, I came across a similar issue on react-table, where they came to the conclusion that the lack of a prototype on arrow functions was the root cause and the method that they had in place to normalize, didn't cover that. @rpalermodrums suggested using Object.getPrototypeOf as a solution. It works for me locally, so fingers crossed. I'm still a little new to software engineering, so I can't say that I'm fully confident that I understand what the potential ramifications are, although it seems pretty straight-forward. Please don't kill me.

sedlukha commented 5 years ago

Can this be merged?

DiFuks commented 1 year ago

Why was it closed? :( I have the same problem with arrow function components