Skip to content

Skip static view config verification without native view configs - #60361

Draft
ide wants to merge 1 commit into
react:mainfrom
expo:@ide/skip-unavailable-view-config-verification
Draft

ide wants to merge 1 commit into
react:mainfrom
expo:@ide/skip-unavailable-view-config-verification

Conversation

@ide

@ide ide commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary:

A bridgeless host can turn on static view config verification with NativeComponentRegistry.setRuntimeConfigProvider(() => ({native: false, verify: true})). If the host has no legacy view config interop binding, each native component then logs a console.error the first time it is used:

[ReactNative Architecture][JS] 'getViewManagerConfig('RCTView')' is not available in the new React Native architecture. If 'RCTView' has a ViewManager and you want to retrieve its native ViewConfig, please turn on the native ViewConfig interop layer. ...

Verification compares a component's static view config with its native one. In bridgeless mode, UIManager.getViewManagerConfig reads native view configs from the binding global.RN$LegacyInterop_UIManager_getConstants. Without the binding, the call logs the error above and returns null for every component, and verification then does nothing.

The binding is absent in two cases:

  • useNativeViewConfigsInBridgelessMode is off. It is off in ReactNativeFeatureFlagsDefaults; the stock entry points turn it on (RCTReactNativeFactory on iOS through the OSS overrides, ReactNativeNewArchitectureFeatureFlagsDefaults on Android), so this affects hosts that set up feature flags another way.
  • An iOS app is built with RCT_REMOVE_LEGACY_COMPONENT_INTEROP, which compiles the binding out whatever the flag says (RCTInstance.mm).

RNTester sets this runtime config in bridgeless development builds, but with its default feature flag overrides the binding is present, so it logs the errors only when built with RCT_REMOVE_LEGACY_COMPONENT_INTEROP.

NativeComponentRegistry.get now skips verification when the binding is absent, without asking for the native view config. Nothing was being verified in that case, so the only change is that the errors stop.

getWithFallback_DEPRECATED reaches the same error another way. With no runtime config provider set, it checks that a component exists with getViewManagerConfig(name) != null, which in bridgeless mode without the binding logs the error and returns the fallback component for a component that exists. It now calls hasViewManagerConfig(name). On the old architecture that is the same null check; in bridgeless mode it asks the native component registry.

Changelog:

[GENERAL] [FIXED] - Stop logging a getViewManagerConfig error for every component when static view config verification is on in bridgeless mode

Test Plan:

Run against 94aee19ac9. The new NativeComponentRegistry-test.js has four cases:

yarn jest --runInBand packages/react-native/Libraries/NativeComponent/__tests__/NativeComponentRegistry-test.js
  • With NativeComponentRegistry.js from main: 2 of 4 fail. Verification requests the native view config in bridgeless mode without the interop binding, and getWithFallback_DEPRECATED returns the fallback for a registered component.
  • This branch: 4 of 4 pass.
  • Replacing either half of the new condition with true (global.RN$Bridgeless === true, or the check for global.RN$LegacyInterop_UIManager_getConstants) fails the case that covers it. The tests set the binding itself, so they cover both ways it can be absent.
yarn jest --runInBand packages/react-native/Libraries/NativeComponent packages/react-native/Libraries/ReactNative packages/react-native/Libraries/Utilities/__tests__/codegenNativeComponent-test.js

5 suites and 17 tests pass. yarn flow-check reports no errors. yarn eslint --max-warnings 0 and prettier --check pass on both changed files. No exported signature changes, so I did not run yarn build-types.

I did not run an app without the binding to watch the errors stop on a device.

🤖 Generated with Claude Code

A bridgeless host that sets
`setRuntimeConfigProvider(() => ({native: false, verify: true}))` and
has no legacy view config interop binding logs a console.error the
first time each native component is used:

  [ReactNative Architecture][JS] 'getViewManagerConfig('RCTView')' is
  not available in the new React Native architecture. ...

Verification compares a component's static view config with its native
one. In bridgeless mode, `UIManager.getViewManagerConfig` reads native
view configs from `global.RN$LegacyInterop_UIManager_getConstants`.
Native installs that binding only when
`useNativeViewConfigsInBridgelessMode` is on, and an iOS build with
`RCT_REMOVE_LEGACY_COMPONENT_INTEROP` never installs it. Without the
binding, the call logs the error and returns null for every component,
and verification then does nothing.

The flag is off in `ReactNativeFeatureFlagsDefaults`. The stock entry
points turn it on (`RCTReactNativeFactory` on iOS, the new architecture
defaults on Android), so RNTester as shipped is affected only when it
is built with `RCT_REMOVE_LEGACY_COMPONENT_INTEROP`.

`NativeComponentRegistry.get` now skips verification when the binding
is absent, without asking for the native view config.

`getWithFallback_DEPRECATED` reaches the same error another way. With
no runtime config provider set, it checks that a component exists with
`getViewManagerConfig(name) != null`, which logs the error and returns
the fallback for a component that exists. It now calls
`hasViewManagerConfig(name)`, which is the same null check on the old
architecture and asks the native component registry in bridgeless mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant