mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[Native] If statement cleanup for null targets (#17346)
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user