(topLevelType, nativeEvent)
| 5243 | } |
| 5244 | |
| 5245 | function dispatchEvent(topLevelType, nativeEvent) { |
| 5246 | if (!_enabled) { |
| 5247 | return; |
| 5248 | } |
| 5249 | |
| 5250 | var nativeEventTarget = getEventTarget(nativeEvent); |
| 5251 | var targetInst = getClosestInstanceFromNode(nativeEventTarget); |
| 5252 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { |
| 5253 | // If we get an event (ex: img onload) before committing that |
| 5254 | // component's mount, ignore it for now (that is, treat it as if it was an |
| 5255 | // event on a non-React tree). We might also consider queueing events and |
| 5256 | // dispatching them after the mount. |
| 5257 | targetInst = null; |
| 5258 | } |
| 5259 | |
| 5260 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); |
| 5261 | |
| 5262 | try { |
| 5263 | // Event queue being processed in the same cycle allows |
| 5264 | // `preventDefault`. |
| 5265 | batchedUpdates(handleTopLevel, bookKeeping); |
| 5266 | } finally { |
| 5267 | releaseTopLevelCallbackBookKeeping(bookKeeping); |
| 5268 | } |
| 5269 | } |
| 5270 | |
| 5271 | var ReactDOMEventListener = Object.freeze({ |
| 5272 | get _enabled () { return _enabled; }, |
nothing calls this directly
no test coverage detected