mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-03 07:14:59 +08:00
When creating a View using NativeViewHierarchyManager, pass ThemedReactContext instead of root view tag
Summary: public NativeViewHierarchyManager.createView() takes int rootViewTag which is only used to resolve ThemedReactContext, but we already have it resolved before we enqueueCreateView, so we can just pass it directly. This makes mRootViewsContext tag -> to ThemedReactContext mapping unnecessary in NativeViewHierarchyManager. Makes the class simpler. Reviewed By: kmagiera, astreet Differential Revision: D2460280 fb-gh-sync-id: 68c503f4fb37ca0b1dcb2abc9e0c33a5225d1f6a
This commit is contained in:
committed by
facebook-github-bot-4
parent
c4c74215fa
commit
fe28118a48
@@ -122,17 +122,17 @@ public class UIViewOperationQueue {
|
||||
|
||||
private final class CreateViewOperation extends ViewOperation {
|
||||
|
||||
private final int mRootViewTagForContext;
|
||||
private final ThemedReactContext mThemedContext;
|
||||
private final String mClassName;
|
||||
private final @Nullable CatalystStylesDiffMap mInitialProps;
|
||||
|
||||
public CreateViewOperation(
|
||||
int rootViewTagForContext,
|
||||
ThemedReactContext themedContext,
|
||||
int tag,
|
||||
String className,
|
||||
@Nullable CatalystStylesDiffMap initialProps) {
|
||||
super(tag);
|
||||
mRootViewTagForContext = rootViewTagForContext;
|
||||
mThemedContext = themedContext;
|
||||
mClassName = className;
|
||||
mInitialProps = initialProps;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ public class UIViewOperationQueue {
|
||||
@Override
|
||||
public void execute() {
|
||||
mNativeViewHierarchyManager.createView(
|
||||
mRootViewTagForContext,
|
||||
mThemedContext,
|
||||
mTag,
|
||||
mClassName,
|
||||
mInitialProps);
|
||||
@@ -533,13 +533,13 @@ public class UIViewOperationQueue {
|
||||
}
|
||||
|
||||
public void enqueueCreateView(
|
||||
int rootViewTagForContext,
|
||||
ThemedReactContext themedContext,
|
||||
int viewReactTag,
|
||||
String viewClassName,
|
||||
@Nullable CatalystStylesDiffMap initialProps) {
|
||||
mOperations.add(
|
||||
new CreateViewOperation(
|
||||
rootViewTagForContext,
|
||||
themedContext,
|
||||
viewReactTag,
|
||||
viewClassName,
|
||||
initialProps));
|
||||
|
||||
Reference in New Issue
Block a user