Skip to content

Commit

Permalink
Static view configs take precedence over native view configs
Browse files Browse the repository at this point in the history
Summary: Changelog: [Internal]

Differential Revision: D49413562

fbshipit-source-id: ba96aede8c056dfe7d187f2d62ae0dcc4db9de6e
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Sep 20, 2023
1 parent ec29c2d commit bb374c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ export function get<Config>(
verify: false,
};

const viewConfig = native
? getNativeComponentAttributes(name)
: createViewConfig(viewConfigProvider());
let viewConfig = createViewConfig(viewConfigProvider());
if (viewConfig == null) {
// Fallback to native view config.
viewConfig = getNativeComponentAttributes(name);
}

if (verify) {
const nativeViewConfig = native
Expand Down
9 changes: 0 additions & 9 deletions packages/rn-tester/js/RNTesterAppShared.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,6 @@ import {BackHandler, StyleSheet, View, useColorScheme} from 'react-native';

// RNTester App currently uses in memory storage for storing navigation state

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};
},
);
}

const RNTesterApp = (): React.Node => {
const [state, dispatch] = React.useReducer(
RNTesterNavigationReducer,
Expand Down

0 comments on commit bb374c0

Please sign in to comment.