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:
Rubén Norte 2023-03-15 10:30:40 +00:00 committed by GitHub
parent cfc1274e3b
commit 47cf4e578c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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,