(topLevelType, nativeEvent)
| 6012 | } |
| 6013 | |
| 6014 | function dispatchEvent(topLevelType, nativeEvent) { |
| 6015 | if (!_enabled) { |
| 6016 | return; |
| 6017 | } |
| 6018 | |
| 6019 | var nativeEventTarget = getEventTarget(nativeEvent); |
| 6020 | var targetInst = getClosestInstanceFromNode(nativeEventTarget); |
| 6021 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { |
| 6022 | // If we get an event (ex: img onload) before committing that |
| 6023 | // component's mount, ignore it for now (that is, treat it as if it was an |
| 6024 | // event on a non-React tree). We might also consider queueing events and |
| 6025 | // dispatching them after the mount. |
| 6026 | targetInst = null; |
| 6027 | } |
| 6028 | |
| 6029 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); |
| 6030 | |
| 6031 | try { |
| 6032 | // Event queue being processed in the same cycle allows |
| 6033 | // `preventDefault`. |
| 6034 | batchedUpdates(handleTopLevel, bookKeeping); |
| 6035 | } finally { |
| 6036 | releaseTopLevelCallbackBookKeeping(bookKeeping); |
| 6037 | } |
| 6038 | } |
| 6039 | |
| 6040 | var ReactDOMEventListener = Object.freeze({ |
| 6041 | get _enabled () { return _enabled; }, |
nothing calls this directly
no test coverage detected