(topLevelType, nativeEvent)
| 6057 | } |
| 6058 | |
| 6059 | function dispatchEvent(topLevelType, nativeEvent) { |
| 6060 | if (!_enabled) { |
| 6061 | return; |
| 6062 | } |
| 6063 | |
| 6064 | var nativeEventTarget = getEventTarget(nativeEvent); |
| 6065 | var targetInst = getClosestInstanceFromNode(nativeEventTarget); |
| 6066 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { |
| 6067 | // If we get an event (ex: img onload) before committing that |
| 6068 | // component's mount, ignore it for now (that is, treat it as if it was an |
| 6069 | // event on a non-React tree). We might also consider queueing events and |
| 6070 | // dispatching them after the mount. |
| 6071 | targetInst = null; |
| 6072 | } |
| 6073 | |
| 6074 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); |
| 6075 | |
| 6076 | try { |
| 6077 | // Event queue being processed in the same cycle allows |
| 6078 | // `preventDefault`. |
| 6079 | batchedUpdates(handleTopLevel, bookKeeping); |
| 6080 | } finally { |
| 6081 | releaseTopLevelCallbackBookKeeping(bookKeeping); |
| 6082 | } |
| 6083 | } |
| 6084 | |
| 6085 | var ReactDOMEventListener = Object.freeze({ |
| 6086 | get _enabled () { return _enabled; }, |
nothing calls this directly
no test coverage detected