mirror of
https://github.com/status-im/react-native.git
synced 2025-02-22 14:18:23 +00:00
Force navigation to use root tag
Summary: This diff ensures that JS uses rootTags during navigation. A redbox will be rendered in debug mode when a non-rootTag is used during navigation. This change enables proper navigation for Fabric. Reviewed By: shergin Differential Revision: D10855198 fbshipit-source-id: a82aaa706cd62ce92143fa86d0a422c1ae439a50
This commit is contained in:
parent
cd5009f713
commit
fe7eb61989
@ -806,7 +806,9 @@ public class UIManagerModule extends ReactContextBaseJavaModule
|
||||
* @return the rootTag
|
||||
*/
|
||||
public int resolveRootTagFromReactTag(int reactTag) {
|
||||
return mUIImplementation.resolveRootTagFromReactTag(reactTag);
|
||||
return ViewUtil.isRootTag(reactTag)
|
||||
? reactTag
|
||||
: mUIImplementation.resolveRootTagFromReactTag(reactTag);
|
||||
}
|
||||
|
||||
/** Dirties the node associated with the given react tag */
|
||||
|
@ -25,4 +25,13 @@ public class ViewUtil {
|
||||
return DEFAULT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param reactTag {@link int} react tag
|
||||
* @return if the react tag received by parameter is a RootTag or not.
|
||||
*/
|
||||
@Deprecated
|
||||
public static boolean isRootTag(int reactTag) {
|
||||
return reactTag % 10 == 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user