Skip to content

Commit 958f8e2

Browse files
Remove deprecated measureLayoutRelativeToParent of UIManagerModule (#44452)
Summary: Pull Request resolved: #44452 `measureLayoutRelativeToParent` was deprecated 5 years ago in D16471845 and doesn't have [JS usages](https://fburl.com/code/tgwon7nb) For the JS exposed UIManager API for measureLayoutRelativeToParent is through [UIImplementation.measureLayoutRelativeToParent()](https://www.internalfb.com/code/fbsource/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java?lines=804-815) Hence deleting this for 0.75 Release. This will simplify the backwards compatibility of UIManagerModule Changelog: [Android][Removed] Delete UIManagerModule.measureLayoutRelativeToParent() Reviewed By: javache Differential Revision: D57069921 fbshipit-source-id: 9f871424a39caf3cbeaa5570c7e101a714c11aa6
1 parent 4290ef5 commit 958f8e2

3 files changed

Lines changed: 0 additions & 35 deletions

File tree

packages/react-native/React/Modules/RCTUIManager.m

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,24 +1384,6 @@ static void RCTMeasureLayout(RCTShadowView *view, RCTShadowView *ancestor, RCTRe
13841384
RCTMeasureLayout(shadowView, ancestorShadowView, callback);
13851385
}
13861386

1387-
/**
1388-
* Returns the computed recursive offset layout in a dictionary form. The
1389-
* returned values are relative to the `ancestor` shadow view. Returns `nil`, if
1390-
* the `ancestor` shadow view is not actually an `ancestor`. Does not touch
1391-
* anything on the main UI thread. Invokes supplied callback with (x, y, width,
1392-
* height).
1393-
*/
1394-
RCT_EXPORT_METHOD(measureLayoutRelativeToParent
1395-
: (nonnull NSNumber *)reactTag errorCallback
1396-
: (__unused RCTResponseSenderBlock)errorCallback callback
1397-
: (RCTResponseSenderBlock)callback)
1398-
{
1399-
RCTLogWarn(
1400-
@"RCTUIManager.measureLayoutRelativeToParent method is deprecated and it will not be implemented in newer versions of RN (Fabric) - T47686450");
1401-
RCTShadowView *shadowView = _shadowViewRegistry[reactTag];
1402-
RCTMeasureLayout(shadowView, shadowView.reactSuperview, callback);
1403-
}
1404-
14051387
/**
14061388
* JS sets what *it* considers to be the responder. Later, scroll views can use
14071389
* this in order to determine if scrolling is appropriate.

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5069,7 +5069,6 @@ public class com/facebook/react/uimanager/UIManagerModule : com/facebook/react/b
50695069
public fun measure (ILcom/facebook/react/bridge/Callback;)V
50705070
public fun measureInWindow (ILcom/facebook/react/bridge/Callback;)V
50715071
public fun measureLayout (IILcom/facebook/react/bridge/Callback;Lcom/facebook/react/bridge/Callback;)V
5072-
public fun measureLayoutRelativeToParent (ILcom/facebook/react/bridge/Callback;Lcom/facebook/react/bridge/Callback;)V
50735072
public fun onBatchComplete ()V
50745073
public fun onHostDestroy ()V
50755074
public fun onHostPause ()V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -525,22 +525,6 @@ public void measureLayout(
525525
mUIImplementation.measureLayout(tag, ancestorTag, errorCallback, successCallback);
526526
}
527527

528-
/**
529-
* Like {@link #measure} and {@link #measureLayout} but measures relative to the immediate parent.
530-
*
531-
* <p>NB: Unlike {@link #measure}, this will measure relative to the view layout, not the visible
532-
* window which can cause unexpected results when measuring relative to things like ScrollViews
533-
* that can have offset content on the screen.
534-
*
535-
* @deprecated this method will not be available in FabricUIManager class.
536-
*/
537-
@ReactMethod
538-
@Deprecated
539-
public void measureLayoutRelativeToParent(
540-
int tag, Callback errorCallback, Callback successCallback) {
541-
mUIImplementation.measureLayoutRelativeToParent(tag, errorCallback, successCallback);
542-
}
543-
544528
/**
545529
* Find the touch target child native view in the supplied root view hierarchy, given a react
546530
* target location.

0 commit comments

Comments
 (0)