Skip to content

Commit ed60efb

Browse files
committed
Small byte-saver
1 parent 94d55f8 commit ed60efb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/react-dom/src/events/SimpleEventPlugin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const topLevelEventsToDispatchConfig: {
137137
});
138138

139139
// Only used in DEV for exhaustiveness validation.
140-
const knownHTMLTopLevelTypes = [
140+
let knownHTMLTopLevelTypes = __DEV__ && [
141141
'topAbort',
142142
'topCancel',
143143
'topCanPlay',
@@ -219,6 +219,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
219219
case 'topMouseOut':
220220
case 'topMouseOver':
221221
case 'topContextMenu':
222+
222223
EventConstructor = SyntheticMouseEvent;
223224
break;
224225
case 'topDrag':
@@ -258,7 +259,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
258259
break;
259260
default:
260261
if (__DEV__) {
261-
if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
262+
if ((knownHTMLTopLevelTypes: any).indexOf(topLevelType) === -1) {
262263
warning(
263264
false,
264265
'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' +

0 commit comments

Comments
 (0)