MCPcopy
hub / github.com/Pomax/react-onclickoutside / getEventHandlerOptions

Function getEventHandlerOptions

src/index.js:18–27  ·  view source on GitHub ↗

* Options for addEventHandler and removeEventHandler

(instance, eventName)

Source from the content-addressed store, hash-verified

16 * Options for addEventHandler and removeEventHandler
17 */
18function getEventHandlerOptions(instance, eventName) {
19 const handlerOptions = {};
20 const isTouchEvent = touchEvents.indexOf(eventName) !== -1;
21
22 if (isTouchEvent && passiveEventSupport) {
23 handlerOptions.passive = !instance.props.preventDefault;
24 }
25
26 return handlerOptions;
27}
28
29/**
30 * This function generates the HOC function that you'll use

Callers 1

onClickOutsideClass · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected