Skip to content

Commit 0c1adf5

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Add warning when app is running with the old architecture (#50735)
Summary: Pull Request resolved: #50735 This change adds a warning in JS that is printed when the app is running using the old architecture. The assumption is that, if it is running with Fabric, it is running with the new architecture. So running without Fabric implies old architecture. ## Changelog: [General][Added] - Add warning when the app runs with the legacy architecture Reviewed By: cortinico, rubennorte Differential Revision: D73041156
1 parent e0a506f commit 0c1adf5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/react-native/Libraries/ReactNative/renderApplication.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,14 @@ export default function renderApplication<Props: Object>(
104104
useFabric: Boolean(fabric),
105105
useConcurrentRoot,
106106
});
107+
108+
const newArchitecture = !!fabric;
109+
if (!newArchitecture) {
110+
const warnOnce = require('../Utilities/warnOnce').default;
111+
warnOnce(
112+
'[OSS][OldArchDeprecatedWarning]',
113+
'The app is running using the Legacy Architecture. The Legacy Architecture is deprecated and will be removed in a future version of React Native. Please consider migrating to the New Architecture. For more information, please see https://reactnative.dev/blog/2024/10/23/the-new-architecture-is-here',
114+
);
115+
}
107116
performanceLogger.stopTimespan('renderApplication_React_render');
108117
}

0 commit comments

Comments
 (0)