From 2de964cfd229e56eeae8b6e0a7a516ff3a1498ac Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Mon, 25 Sep 2023 13:03:57 -0700 Subject: [PATCH] Set runtime config provider for the Template (#39633) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39633 This diff sets runtime config provider for the template. It sets `native` to `false` to prioritize static view configs over native view configs. Changelog: [Breaking] - Set runtime config provider for the Template. Reviewed By: luluwu2032 Differential Revision: D49604628 fbshipit-source-id: 0ea19eb76fc67d0df862b82ec4b9d172ae92d56d --- packages/react-native/template/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/react-native/template/index.js b/packages/react-native/template/index.js index a850d031de7..cd33b74bb3a 100644 --- a/packages/react-native/template/index.js +++ b/packages/react-native/template/index.js @@ -6,4 +6,13 @@ import {AppRegistry} from 'react-native'; import App from './App'; import {name as appName} from './app.json'; +if (global.RN$Bridgeless) { + require('react-native/Libraries/NativeComponent/NativeComponentRegistry').setRuntimeConfigProvider( + name => { + // In bridgeless mode, never load native ViewConfig. + return {native: false, strict: false, verify: false}; + }, + ); +} + AppRegistry.registerComponent(appName, () => App);