Partial React Sync from 241c4467e...00d8e5b80

Summary:
- **[00d8e5b80](https://github.com/facebook/react/commit/00d8e5b80 )**: [Fabric] Fix targetAsInstance dispatchEvent "cannot read property of null" (#18156) //<Joshua Gross>//
- **[ad84625f8](https://github.com/facebook/react/commit/ad84625f8 )**: [Native] Migrate focus/blur to call TextInputState with the host component (#18068) //<Eli White>//
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//
- **[a6dfe9aa4](https://github.com/facebook/react/commit/a6dfe9aa4 )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//

Changelog:
[General][React] Partial React Sync from 241c4467e...00d8e5b80

Reviewed By: JoshuaGross

Differential Revision: D20153744

fbshipit-source-id: 09c5fec620370f1844a89af1c6ba2d487020216d
This commit is contained in:
Eli White
2020-02-27 19:39:26 -08:00
committed by Facebook Github Bot
parent 576ddfb3a8
commit 9fdb96eec7
4 changed files with 22 additions and 8 deletions
@@ -3828,7 +3828,11 @@ function dispatchEvent(target, topLevelType, nativeEvent) {
if (enableNativeTargetAsInstance) {
if (targetFiber != null) {
eventTarget = targetFiber.stateNode.canonical;
var stateNode = targetFiber.stateNode; // Guard against Fiber being unmounted
if (stateNode != null) {
eventTarget = stateNode.canonical;
}
}
} else {
eventTarget = nativeEvent.target;
@@ -3826,7 +3826,11 @@ function dispatchEvent(target, topLevelType, nativeEvent) {
if (enableNativeTargetAsInstance) {
if (targetFiber != null) {
eventTarget = targetFiber.stateNode.canonical;
var stateNode = targetFiber.stateNode; // Guard against Fiber being unmounted
if (stateNode != null) {
eventTarget = stateNode.canonical;
}
}
} else {
eventTarget = nativeEvent.target;
@@ -1467,9 +1467,12 @@ function batchedUpdates(fn, bookkeeping) {
}
function dispatchEvent(target, topLevelType, nativeEvent) {
var eventTarget = null;
enableNativeTargetAsInstance
? null != target && (eventTarget = target.stateNode.canonical)
: (eventTarget = nativeEvent.target);
if (enableNativeTargetAsInstance) {
if (null != target) {
var stateNode = target.stateNode;
null != stateNode && (eventTarget = stateNode.canonical);
}
} else eventTarget = nativeEvent.target;
batchedUpdates(function() {
var events = eventTarget;
for (var events$jscomp$0 = null, i = 0; i < plugins.length; i++) {
@@ -1468,9 +1468,12 @@ function batchedUpdates(fn, bookkeeping) {
}
function dispatchEvent(target, topLevelType, nativeEvent) {
var eventTarget = null;
enableNativeTargetAsInstance
? null != target && (eventTarget = target.stateNode.canonical)
: (eventTarget = nativeEvent.target);
if (enableNativeTargetAsInstance) {
if (null != target) {
var stateNode = target.stateNode;
null != stateNode && (eventTarget = stateNode.canonical);
}
} else eventTarget = nativeEvent.target;
batchedUpdates(function() {
var events = eventTarget;
for (var events$jscomp$0 = null, i = 0; i < plugins.length; i++) {