Repository navigation
Conversation
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>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 aconsole.errorthe first time it is used:Verification compares a component's static view config with its native one. In bridgeless mode,
UIManager.getViewManagerConfigreads native view configs from the bindingglobal.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:
useNativeViewConfigsInBridgelessModeis off. It is off inReactNativeFeatureFlagsDefaults; the stock entry points turn it on (RCTReactNativeFactoryon iOS through the OSS overrides,ReactNativeNewArchitectureFeatureFlagsDefaultson Android), so this affects hosts that set up feature flags another way.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.getnow 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_DEPRECATEDreaches the same error another way. With no runtime config provider set, it checks that a component exists withgetViewManagerConfig(name) != null, which in bridgeless mode without the binding logs the error and returns the fallback component for a component that exists. It now callshasViewManagerConfig(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
getViewManagerConfigerror for every component when static view config verification is on in bridgeless modeTest Plan:
Run against
94aee19ac9. The newNativeComponentRegistry-test.jshas four cases:NativeComponentRegistry.jsfrommain: 2 of 4 fail. Verification requests the native view config in bridgeless mode without the interop binding, andgetWithFallback_DEPRECATEDreturns the fallback for a registered component.true(global.RN$Bridgeless === true, or the check forglobal.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.5 suites and 17 tests pass.
yarn flow-checkreports no errors.yarn eslint --max-warnings 0andprettier --checkpass on both changed files. No exported signature changes, so I did not runyarn build-types.I did not run an app without the binding to watch the errors stop on a device.
🤖 Generated with Claude Code