Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions packages/react-native/React/Modules/RCTUIManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1381,6 +1381,14 @@ - (void)_dispatchPropsDidChangeEvents
rootView = rootView.superview;
}

// It is possible that the RootView can't be found because this view is no longer on the screen
// and has been removed by clipping (eg. by setting the `removeClippedSubview` prop to `true`)
if (![rootView isReactRootView]) {
RCTLogError(@"measure cannot find react root view for view with tag #%@", reactTag);
callback(@[ @(0), @(0), @(0), @(0), @(0), @(0) ]);
return;
}

// By convention, all coordinates, whether they be touch coordinates, or
// measurement coordinates are with respect to the root view.
CGRect frame = view.frame;
Expand Down