(topLevelType, nativeEvent)
| 5919 | } |
| 5920 | |
| 5921 | function dispatchEvent(topLevelType, nativeEvent) { |
| 5922 | if (!_enabled) { |
| 5923 | return; |
| 5924 | } |
| 5925 | |
| 5926 | var nativeEventTarget = getEventTarget(nativeEvent); |
| 5927 | var targetInst = getClosestInstanceFromNode(nativeEventTarget); |
| 5928 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { |
| 5929 | // If we get an event (ex: img onload) before committing that |
| 5930 | // component's mount, ignore it for now (that is, treat it as if it was an |
| 5931 | // event on a non-React tree). We might also consider queueing events and |
| 5932 | // dispatching them after the mount. |
| 5933 | targetInst = null; |
| 5934 | } |
| 5935 | |
| 5936 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); |
| 5937 | |
| 5938 | try { |
| 5939 | // Event queue being processed in the same cycle allows |
| 5940 | // `preventDefault`. |
| 5941 | batchedUpdates(handleTopLevel, bookKeeping); |
| 5942 | } finally { |
| 5943 | releaseTopLevelCallbackBookKeeping(bookKeeping); |
| 5944 | } |
| 5945 | } |
| 5946 | |
| 5947 | var ReactDOMEventListener = Object.freeze({ |
| 5948 | get _enabled () { return _enabled; }, |
nothing calls this directly
no test coverage detected