Removed harmful optimization in ReactNativeEventEmitter

Reviewed By: spicyj

Differential Revision: D4729779

fbshipit-source-id: 2dd5ec10d42df7f24804796c4100eca107edeedb
This commit is contained in:
Valentin Shergin 2017-03-19 21:43:14 -07:00 committed by Facebook Github Bot
parent 47d2cfeac5
commit 23c2a6cf1a
2 changed files with 1 additions and 6 deletions

View File

@ -103,11 +103,6 @@ var ReactNativeEventEmitter = {
) {
var nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT;
var inst = ReactNativeComponentTree.getInstanceFromNode(rootNodeID);
if (!inst) {
// If the original instance is already gone, we don't have to dispatch
// any events.
return;
}
ReactGenericBatching.batchedUpdates(function() {
ReactNativeEventEmitter.handleTopLevel(
topLevelType,

View File

@ -93,7 +93,7 @@ function accumulateTwoPhaseDispatchesSingleSkipTarget(event) {
* requiring that the `dispatchMarker` be the same as the dispatched ID.
*/
function accumulateDispatches(inst, ignoredDirection, event) {
if (event && event.dispatchConfig.registrationName) {
if (inst && event && event.dispatchConfig.registrationName) {
var registrationName = event.dispatchConfig.registrationName;
var listener = getListener(inst, registrationName);
if (listener) {