Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ protected Void doInBackground(Void... params) {
@Override
protected void onPostExecute(Void aVoid) {
getReactNativeHost().getReactInstanceManager().attachMeasuredRootView(mReactRootView);
Utils.setViewAttached(mReactRootView, true);
}

}
Expand Down
12 changes: 12 additions & 0 deletions split-example/android/app/src/main/java/com/example/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ static void setJsModuleName(ReactRootView rootView, String moduleName) {
}
}

public static void setViewAttached(ReactRootView rootView, boolean bAttached) {
try {
Field field = ReactRootView.class.getDeclaredField("mIsAttachedToInstance");
field.setAccessible(true);
field.set(rootView, bAttached);
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}

@Nullable
static CatalystInstance getCatalystInstance(ReactNativeHost host) {
ReactInstanceManager manager = host.getReactInstanceManager();
Expand Down