mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Ensure legacy architecture can't be initialized in Android (#53806)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53806 The Legacy architecture of React Native is not supported anymore, let's ensure nobody can initialize it anymore changelog: [internal] internal Reviewed By: cortinico Differential Revision: D82465004 fbshipit-source-id: 099764fb59d906b11cf6ad0cc6208f56df029d19
This commit is contained in:
committed by
Facebook GitHub Bot
parent
dadd7cdaf7
commit
18cb4edfa7
+10
@@ -328,6 +328,15 @@ public class ReactInstanceManager {
|
||||
}
|
||||
|
||||
registerCxxErrorHandlerFunc();
|
||||
|
||||
// Using `if (true)` just to prevent tests / lint errors.
|
||||
if (true) {
|
||||
// Legacy architecture of React Native is deprecated and can't be initialized anymore.
|
||||
// More details on:
|
||||
// https://github.com/react-native-community/discussions-and-proposals/blob/nc/legacy-arch-removal/proposals/0929-legacy-architecture-removal.md
|
||||
throw new UnsupportedOperationException(
|
||||
"ReactInstanceManager.createReactContext is unsupported.");
|
||||
}
|
||||
}
|
||||
|
||||
private ReactInstanceDevHelper createDevHelperInterface() {
|
||||
@@ -1446,6 +1455,7 @@ public class ReactInstanceManager {
|
||||
*/
|
||||
private ReactApplicationContext createReactContext(
|
||||
JavaScriptExecutor jsExecutor, JSBundleLoader jsBundleLoader) {
|
||||
|
||||
FLog.d(ReactConstants.TAG, "ReactInstanceManager.createReactContext()");
|
||||
ReactMarker.logMarker(CREATE_REACT_CONTEXT_START, jsExecutor.getName());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user