[Native] If statement cleanup for null targets (#17346)
This commit is contained in:
parent
3dcec3a925
commit
ade764157f
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue