Skip to content

Commit

Permalink
Prevent reading canonical property of null (facebook#21242)
Browse files Browse the repository at this point in the history
* Prevent reading canonical property of null

* prettier
  • Loading branch information
JoshuaGross authored and koto committed Jun 15, 2021
1 parent 06f92da commit 29e1fbc
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateI
const ReactFabricGlobalResponderHandler = {
onChange: function(from: any, to: any, blockNativeResponder: boolean) {
const fromOrTo = from || to;
const isFabric = !!fromOrTo.stateNode.canonical._internalInstanceHandle;
const fromOrToStateNode = fromOrTo && fromOrTo.stateNode;
const isFabric = !!(
fromOrToStateNode && fromOrToStateNode.canonical._internalInstanceHandle
);

if (isFabric) {
// Noop for now until setJSResponder/clearJSResponder are supported in Fabric
Expand Down

0 comments on commit 29e1fbc

Please sign in to comment.