An onClickOutside wrapper for React components
Fixed removing event listeners in some browsers.
8% gain in lib's size
componentDidMount
to the constructor, otherwise if enableOnClickOutside
got called before componentDidMount
(i.e. in WrappedComponent
's componentDidMount) the handler got registered under undefined "uid"IGNORE_CLASS_NAME
so it may be used as constant instead of hard-coding it in the projectspassive
listeners under the hoodnull
, handling attachment/deattachment of internal DOM listeners automatically in such casespassive
setting for the touch events (based on the preventDefault
prop)