MCPcopy Create free account
hub / github.com/Lobos/react-ui / executeDirectDispatch

Function executeDirectDispatch

docs/lib/react.js:2941–2954  ·  view source on GitHub ↗

* Execution of a "direct" dispatch - there must be at most one dispatch * accumulated on the event or it is considered an error. It doesn't really make * sense for an event with multiple dispatches (bubbled) to keep track of the * return values at each dispatch execution, but it does tend to make

(event)

Source from the content-addressed store, hash-verified

2939 * @return {*} The return value of executing the single dispatch.
2940 */
2941function executeDirectDispatch(event) {
2942 if ("development" !== 'production') {
2943 validateEventDispatches(event);
2944 }
2945 var dispatchListener = event._dispatchListeners;
2946 var dispatchInstance = event._dispatchInstances;
2947 !!Array.isArray(dispatchListener) ? "development" !== 'production' ? invariant(false, 'executeDirectDispatch(...): Invalid `event`.') : invariant(false) : void 0;
2948 event.currentTarget = EventPluginUtils.getNodeFromInstance(dispatchInstance);
2949 var res = dispatchListener ? dispatchListener(event) : null;
2950 event.currentTarget = null;
2951 event._dispatchListeners = null;
2952 event._dispatchInstances = null;
2953 return res;
2954}
2955
2956/**
2957 * @param {SyntheticEvent} event

Callers

nothing calls this directly

Calls 1

invariantFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…