From c06807154b309bd85626a5e9ca2f23ac7a7750b6 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 19 Oct 2023 06:17:50 -0700 Subject: [PATCH] Warn when fabric is used without concurrent root (#41072) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/41072 As part of the new architecture rollout, we want to simplify our set of supported configurations. Right now it is possible to use Fabric / new architecture without using concurrent root, which prevents us from bringing the new concurrent capabilities to these applications and holds back React renderer code. Changelog: [Deprecated] Using the new architecture without concurrent root will soon not be supported. Reviewed By: rubennorte, sammy-SC Differential Revision: D50425540 fbshipit-source-id: 1ec4c8202074e6ea98178f1a07311fda35b1951b --- packages/react-native/Libraries/ReactNative/AppContainer.js | 1 - .../react-native/Libraries/ReactNative/renderApplication.js | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/ReactNative/AppContainer.js b/packages/react-native/Libraries/ReactNative/AppContainer.js index 247b5c44aa3172..6ad1aa217ab5f9 100644 --- a/packages/react-native/Libraries/ReactNative/AppContainer.js +++ b/packages/react-native/Libraries/ReactNative/AppContainer.js @@ -22,7 +22,6 @@ const reactDevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__; type Props = $ReadOnly<{| children?: React.Node, fabric?: boolean, - useConcurrentRoot?: boolean, rootTag: number | RootTag, initialProps?: {...}, showArchitectureIndicator?: boolean, diff --git a/packages/react-native/Libraries/ReactNative/renderApplication.js b/packages/react-native/Libraries/ReactNative/renderApplication.js index 7a3aeb2e60dfe5..e980b004acf676 100644 --- a/packages/react-native/Libraries/ReactNative/renderApplication.js +++ b/packages/react-native/Libraries/ReactNative/renderApplication.js @@ -83,6 +83,12 @@ export default function renderApplication( ); } + if (fabric && !useConcurrentRoot) { + console.warn( + 'Using Fabric without concurrent root is deprecated. Please enable concurrent root for this application.', + ); + } + performanceLogger.startTimespan('renderApplication_React_render'); performanceLogger.setExtra( 'usedReactConcurrentRoot',