Skip to content

Commit

Permalink
Delete measureLayoutRelativeToParent of UIManagerModule
Browse files Browse the repository at this point in the history
Summary:
`measureLayoutRelativeToParent` was deprecated 5 years ago in D16471845 and doesn't have [JS usages](https://fburl.com/code/tgwon7nb)

Hence deleting this for 0.75 Release. This will simplify the backwards compatibility of UIManagerModule

Changelog:
[Android][Removed] Delete UIManagerModule.measureLayoutRelativeToParent()

Differential Revision: D57069921
  • Loading branch information
arushikesarwani94 authored and facebook-github-bot committed May 7, 2024
1 parent be09d12 commit af5d901
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
18 changes: 0 additions & 18 deletions packages/react-native/React/Modules/RCTUIManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -1384,24 +1384,6 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
RCTMeasureLayout(shadowView, ancestorShadowView, callback);
}

/**
* Returns the computed recursive offset layout in a dictionary form. The
* returned values are relative to the `ancestor` shadow view. Returns `nil`, if
* the `ancestor` shadow view is not actually an `ancestor`. Does not touch
* anything on the main UI thread. Invokes supplied callback with (x, y, width,
* height).
*/
RCT_EXPORT_METHOD(measureLayoutRelativeToParent
: (nonnull NSNumber *)reactTag errorCallback
: (__unused RCTResponseSenderBlock)errorCallback callback
: (RCTResponseSenderBlock)callback)
{
RCTLogWarn(
@"RCTUIManager.measureLayoutRelativeToParent method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450");
RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
RCTMeasureLayout(shadowView, shadowView.reactSuperview, callback);
}

/**
* JS sets what *it* considers to be the responder. Later, scroll views can use
* this in order to determine if scrolling is appropriate.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,22 +525,6 @@ public void measureLayout(
mUIImplementation.measureLayout(tag, ancestorTag, errorCallback, successCallback);
}

/**
* Like {@link #measure} and {@link #measureLayout} but measures relative to the immediate parent.
*
* <p>NB: Unlike {@link #measure}, this will measure relative to the view layout, not the visible
* window which can cause unexpected results when measuring relative to things like ScrollViews
* that can have offset content on the screen.
*
* @deprecated this method will not be available in FabricUIManager class.
*/
@ReactMethod
@Deprecated
public void measureLayoutRelativeToParent(
int tag, Callback errorCallback, Callback successCallback) {
mUIImplementation.measureLayoutRelativeToParent(tag, errorCallback, successCallback);
}

/**
* Find the touch target child native view in the supplied root view hierarchy, given a react
* target location.
Expand Down

0 comments on commit af5d901

Please sign in to comment.