(topLevelType, nativeEvent)
| 5913 | } |
| 5914 | |
| 5915 | function dispatchEvent(topLevelType, nativeEvent) { |
| 5916 | if (!_enabled) { |
| 5917 | return; |
| 5918 | } |
| 5919 | |
| 5920 | var nativeEventTarget = getEventTarget(nativeEvent); |
| 5921 | var targetInst = getClosestInstanceFromNode(nativeEventTarget); |
| 5922 | if (targetInst !== null && typeof targetInst.tag === 'number' && !isFiberMounted(targetInst)) { |
| 5923 | // If we get an event (ex: img onload) before committing that |
| 5924 | // component's mount, ignore it for now (that is, treat it as if it was an |
| 5925 | // event on a non-React tree). We might also consider queueing events and |
| 5926 | // dispatching them after the mount. |
| 5927 | targetInst = null; |
| 5928 | } |
| 5929 | |
| 5930 | var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst); |
| 5931 | |
| 5932 | try { |
| 5933 | // Event queue being processed in the same cycle allows |
| 5934 | // `preventDefault`. |
| 5935 | batchedUpdates(handleTopLevel, bookKeeping); |
| 5936 | } finally { |
| 5937 | releaseTopLevelCallbackBookKeeping(bookKeeping); |
| 5938 | } |
| 5939 | } |
| 5940 | |
| 5941 | var ReactDOMEventListener = Object.freeze({ |
| 5942 | get _enabled () { return _enabled; }, |
nothing calls this directly
no test coverage detected