Back out "[RN][JS] Remove definition of viewIsDescendantOf method in JS"

Summary:
Adding viewIsDescendantOf back again, more context https://github.com/facebook/react-native/commit/9ae7f0c7dac732c8c2f2253699f7bcf04943e98b
This method might no not be implemented in Fabric

Reviewed By: fkgozali

Differential Revision: D16186405

fbshipit-source-id: da91822845e3c7b1f48ebf8c4782f8a2ee593bfe
This commit is contained in:
David Vacca
2019-07-10 20:56:39 -07:00
committed by Facebook Github Bot
parent 458c06b8e7
commit 0fb3fb1d8e
5 changed files with 21 additions and 0 deletions
@@ -1473,6 +1473,10 @@ namespace facebook {
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "measureInWindow", @selector(measureInWindow:callback:), args, count);
}
static facebook::jsi::Value __hostFunction_NativeUIManagerSpecJSI_viewIsDescendantOf(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "viewIsDescendantOf", @selector(viewIsDescendantOf:ancestorReactTag:callback:), args, count);
}
static facebook::jsi::Value __hostFunction_NativeUIManagerSpecJSI_measureLayout(facebook::jsi::Runtime& rt, TurboModule &turboModule, const facebook::jsi::Value* args, size_t count) {
return static_cast<ObjCTurboModule&>(turboModule).invokeObjCMethod(rt, VoidKind, "measureLayout", @selector(measureLayout:ancestorReactTag:errorCallback:callback:), args, count);
}
@@ -1569,6 +1573,9 @@ namespace facebook {
methodMap_["measureInWindow"] = MethodMetadata {2, __hostFunction_NativeUIManagerSpecJSI_measureInWindow};
methodMap_["viewIsDescendantOf"] = MethodMetadata {3, __hostFunction_NativeUIManagerSpecJSI_viewIsDescendantOf};
methodMap_["measureLayout"] = MethodMetadata {4, __hostFunction_NativeUIManagerSpecJSI_measureLayout};
@@ -1641,6 +1641,9 @@ namespace JS {
callback:(RCTResponseSenderBlock)callback;
- (void)measureInWindow:(NSNumber *)reactTag
callback:(RCTResponseSenderBlock)callback;
- (void)viewIsDescendantOf:(NSNumber *)reactTag
ancestorReactTag:(NSNumber *)ancestorReactTag
callback:(RCTResponseSenderBlock)callback;
- (void)measureLayout:(NSNumber *)reactTag
ancestorReactTag:(NSNumber *)ancestorReactTag
errorCallback:(RCTResponseSenderBlock)errorCallback
+5
View File
@@ -61,6 +61,11 @@ module.exports = {
reactTag: ?number,
callback: (x: number, y: number, width: number, height: number) => void,
) => {},
viewIsDescendantOf: (
reactTag: ?number,
ancestorReactTag: ?number,
callback: (result: Array<boolean>) => void,
) => {},
measureLayout: (
reactTag: ?number,
ancestorReactTag: ?number,
+5
View File
@@ -59,6 +59,11 @@ export interface Spec extends TurboModule {
reactTag: ?number,
callback: (x: number, y: number, width: number, height: number) => void,
) => void;
+viewIsDescendantOf: (
reactTag: ?number,
ancestorReactTag: ?number,
callback: (result: Array<boolean>) => void,
) => void;
+measureLayout: (
reactTag: ?number,
ancestorReactTag: ?number,
@@ -49,6 +49,7 @@ module.exports = [
'setLayoutAnimationEnabledExperimental',
'showPopupMenu',
'updateView',
'viewIsDescendantOf',
'PopupMenu',
'LazyViewManagersEnabled',
'ViewManagerNames',