allow finding the rootTag of any reactTag inside UIManager

Summary: added API to in UIManager to find the rootTag/View of any reactTag based on its layout (shadow views) hierarchy (not to be used by JS)

Reviewed By: javache

Differential Revision: D3750410

fbshipit-source-id: 68611e39930d53ece478f25245ddc7f7838daaa6
This commit is contained in:
Kevin Gozali
2016-08-28 22:46:42 -07:00
committed by Facebook Github Bot 9
parent 6729df3f28
commit 35e7a266db
4 changed files with 92 additions and 1 deletions

View File

@@ -518,4 +518,17 @@ public class UIManagerModule extends ReactContextBaseJavaModule implements
public void addUIBlock (UIBlock block) {
mUIImplementation.addUIBlock(block);
}
/**
* Given a reactTag from a component, find its root node tag, if possible.
* Otherwise, this will return 0. If the reactTag belongs to a root node, this
* will return the same reactTag.
*
* @param reactTag the component tag
*
* @return the rootTag
*/
public int resolveRootTagFromReactTag(int reactTag) {
return mUIImplementation.resolveRootTagFromReactTag(reactTag);
}
}