Skip to content

Commit

Permalink
Set runtime config provider for the Template (#39633)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Sep 25, 2023
1 parent af7bf93 commit 2de964c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/react-native/template/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 2de964c

Please sign in to comment.