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
This commit is contained in:
Dmitry Rykun
2023-09-25 13:03:57 -07:00
committed by Facebook GitHub Bot
parent af7bf9371c
commit 2de964cfd2
+9
View File
@@ -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);