Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(android, app): fix hot-reload on react-native <= 0.73 #8160

Merged
merged 1 commit into from
Nov 25, 2024
Merged
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 @@ -92,12 +92,13 @@ public final ExecutorService getTransactionalExecutor(String identifier) {
return executorService.getTransactionalExecutor(identifier);
}


// This is no longer called as of react-native 0.74 and is only here for
// compatibility with older versions. It delegates to thew new `invalidate`
// On react-native 0.73 this is called, but simply calls `invalidate()`
// https://github.com/facebook/react-native/blob/0.73-stable/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BaseJavaModule.java#L65-L72
// This is no longer called ever for react-native >= 0.74 and is only here for
// compatibility with older versions. We delegate to the new `invalidate`
// method, which all modules should implement now
// Remove this method when minimum supported react-native is 0.74
/** @noinspection removal*/
// @noinspection removal
@SuppressWarnings({"deprecation", "removal"})
@Deprecated
public void onCatalystInstanceDestroy() {
Expand All @@ -107,11 +108,14 @@ public void onCatalystInstanceDestroy() {
}

// This should have an @Override annotation but we cannot do
// that until our minimum supported react-native version is 0.74, since the
// method did not exist before then
// that until our minimum supported react-native version is 0.74
//
// No need to call super.invalidate and in fact it is dangerous to do so:
// - did not exist before react-native 0.73
// - on 0.74 it calls onCatalystInstanceDestroy which would infinite loop here
// - on 0.75+ it is empty - meant as sub-class hook only
@CallSuper
public void invalidate() {
super.invalidate();
executorService.shutdown();
}

Expand Down
Loading