Skip to content

Commit

Permalink
Small byte-saver
Browse files Browse the repository at this point in the history
  • Loading branch information
jquense committed Jan 5, 2018
1 parent 94d55f8 commit ed60efb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react-dom/src/events/SimpleEventPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const topLevelEventsToDispatchConfig: {
});

// Only used in DEV for exhaustiveness validation.
const knownHTMLTopLevelTypes = [
let knownHTMLTopLevelTypes = __DEV__ && [
'topAbort',
'topCancel',
'topCanPlay',
Expand Down Expand Up @@ -219,6 +219,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
case 'topMouseOut':
case 'topMouseOver':
case 'topContextMenu':

EventConstructor = SyntheticMouseEvent;
break;
case 'topDrag':
Expand Down Expand Up @@ -258,7 +259,7 @@ const SimpleEventPlugin: PluginModule<MouseEvent> = {
break;
default:
if (__DEV__) {
if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {
if ((knownHTMLTopLevelTypes: any).indexOf(topLevelType) === -1) {
warning(
false,
'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' +
Expand Down

0 comments on commit ed60efb

Please sign in to comment.