mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-04 11:04:58 +00:00
[fix] Prevent injectEventPluginsByName throwing when re-evaluating code
Close #1539
This commit is contained in:
committed by
Nicolas Gallagher
parent
18427aae50
commit
92737d33f4
@@ -16,9 +16,15 @@ import React from 'react';
|
|||||||
import ResponderEventPlugin from '../../modules/ResponderEventPlugin';
|
import ResponderEventPlugin from '../../modules/ResponderEventPlugin';
|
||||||
|
|
||||||
if (canUseDOM) {
|
if (canUseDOM) {
|
||||||
injectEventPluginsByName({
|
try {
|
||||||
ResponderEventPlugin
|
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 =>
|
const isModifiedEvent = event =>
|
||||||
|
|||||||
Reference in New Issue
Block a user