Skip to content

Commit

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

* prettier
  • Loading branch information
JoshuaGross authored Apr 12, 2021
1 parent dd8552a commit 686b635
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

1 comment on commit 686b635

@thorstu22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goodjob

Please sign in to comment.