Skip to content

Commit

Permalink
[Native] If statement cleanup for null targets (#17346)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSavior committed Nov 11, 2019
1 parent 3dcec3a commit ade7641
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 2 additions & 4 deletions packages/react-native-renderer/src/ReactFabricEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ export function dispatchEvent(
);
}

let eventTarget;
let eventTarget = null;
if (enableNativeTargetAsInstance) {
if (targetFiber == null) {
eventTarget = null;
} else {
if (targetFiber != null) {
eventTarget = targetFiber.stateNode.canonical;
}
} else {
Expand Down
6 changes: 2 additions & 4 deletions packages/react-native-renderer/src/ReactNativeEventEmitter.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ function _receiveRootNodeIDEvent(
const nativeEvent = nativeEventParam || EMPTY_NATIVE_EVENT;
const inst = getInstanceFromNode(rootNodeID);

let target;
let target = null;
if (enableNativeTargetAsInstance) {
if (inst == null) {
target = null;
} else {
if (inst != null) {
target = inst.stateNode;
}
} else {
Expand Down

0 comments on commit ade7641

Please sign in to comment.