(topLevelType, nativeEvent)
| 5280 | } |
| 5281 | |
| 5282 | function dispatchEvent(topLevelType, nativeEvent) { |
| 5283 | if (!_enabled) { |
| 5284 | return; |
| 5285 | } |
| 5286 | |
| 5287 | var nativeEventTarget = getEventTarget(nativeEvent); |
| 5288 | var targetInst = getClosestInstanceFromNode(nativeEventTarget); |
| 5289 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { |
| 5290 | // If we get an event (ex: img onload) before committing that |
| 5291 | // component's mount, ignore it for now (that is, treat it as if it was an |
| 5292 | // event on a non-React tree). We might also consider queueing events and |
| 5293 | // dispatching them after the mount. |
| 5294 | targetInst = null; |
| 5295 | } |
| 5296 | |
| 5297 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); |
| 5298 | |
| 5299 | try { |
| 5300 | // Event queue being processed in the same cycle allows |
| 5301 | // `preventDefault`. |
| 5302 | batchedUpdates(handleTopLevel, bookKeeping); |
| 5303 | } finally { |
| 5304 | releaseTopLevelCallbackBookKeeping(bookKeeping); |
| 5305 | } |
| 5306 | } |
| 5307 | |
| 5308 | var ReactDOMEventListener = Object.freeze({ |
| 5309 | get _enabled () { return _enabled; }, |
nothing calls this directly
no test coverage detected