[fix] Prevent injectEventPluginsByName throwing when re-evaluating code

Close #1539
This commit is contained in:
Vladimir Guguiev
2020-02-20 12:02:45 +01:00
committed by Nicolas Gallagher
parent 18427aae50
commit 92737d33f4
@@ -16,9 +16,15 @@ import React from 'react';
import ResponderEventPlugin from '../../modules/ResponderEventPlugin';
if (canUseDOM) {
injectEventPluginsByName({
ResponderEventPlugin
});
try {
injectEventPluginsByName({
ResponderEventPlugin
});
} catch (error) {
// Ignore errors caused by attempting to re-inject the plugin when app
// scripts are being re-evaluated (e.g., development hot reloading) while
// the ReactDOM instance is preserved.
}
}
const isModifiedEvent = event =>