Restore some guards in ReactFabricGlobalResponderHandler after refactor (#26394)
## Summary I refactored this code in #26290 but forgot to add guards when the fiber or the state node where null, and this is typed as `any` so Flow didn't catch it. This restores the same logic to guard against null. ## How did you test this change? Existing tests.
This commit is contained in:
parent
cfc1274e3b
commit
47cf4e578c
|
@ -9,7 +9,7 @@
|
|||
|
||||
const ReactFabricGlobalResponderHandler = {
|
||||
onChange: function (from: any, to: any, blockNativeResponder: boolean) {
|
||||
if (from) {
|
||||
if (from && from.stateNode) {
|
||||
// equivalent to clearJSResponder
|
||||
nativeFabricUIManager.setIsJSResponder(
|
||||
from.stateNode.node,
|
||||
|
@ -18,7 +18,7 @@ const ReactFabricGlobalResponderHandler = {
|
|||
);
|
||||
}
|
||||
|
||||
if (to) {
|
||||
if (to && to.stateNode) {
|
||||
// equivalent to setJSResponder
|
||||
nativeFabricUIManager.setIsJSResponder(
|
||||
to.stateNode.node,
|
||||
|
|
Loading…
Reference in New Issue