Skip to content

Commit

Permalink
Removed harmful optimization in ReactNativeEventEmitter
Browse files Browse the repository at this point in the history
Reviewed By: spicyj

Differential Revision: D4729779

fbshipit-source-id: 2dd5ec10d42df7f24804796c4100eca107edeedb
  • Loading branch information
shergin authored and facebook-github-bot committed Mar 20, 2017
1 parent 47d2cfe commit 23c2a6c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Expand Up @@ -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,
Expand Down
Expand Up @@ -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) {
Expand Down

0 comments on commit 23c2a6c

Please sign in to comment.