(topLevelType, nativeEvent)
| 5792 | } |
| 5793 | |
| 5794 | function dispatchEvent(topLevelType, nativeEvent) { |
| 5795 | if (!_enabled) { |
| 5796 | return; |
| 5797 | } |
| 5798 | |
| 5799 | var nativeEventTarget = getEventTarget(nativeEvent); |
| 5800 | var targetInst = getClosestInstanceFromNode(nativeEventTarget); |
| 5801 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { |
| 5802 | // If we get an event (ex: img onload) before committing that |
| 5803 | // component's mount, ignore it for now (that is, treat it as if it was an |
| 5804 | // event on a non-React tree). We might also consider queueing events and |
| 5805 | // dispatching them after the mount. |
| 5806 | targetInst = null; |
| 5807 | } |
| 5808 | |
| 5809 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); |
| 5810 | |
| 5811 | try { |
| 5812 | // Event queue being processed in the same cycle allows |
| 5813 | // `preventDefault`. |
| 5814 | batchedUpdates(handleTopLevel, bookKeeping); |
| 5815 | } finally { |
| 5816 | releaseTopLevelCallbackBookKeeping(bookKeeping); |
| 5817 | } |
| 5818 | } |
| 5819 | |
| 5820 | var ReactDOMEventListener = Object.freeze({ |
| 5821 | get _enabled () { return _enabled; }, |
nothing calls this directly
no test coverage detected