Skip to content

Stop using paperComponentName in React Native core component specs - #58188

Open
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D117877024
Open

Stop using paperComponentName in React Native core component specs#58188
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D117877024

Conversation

@christophpurrer

Copy link
Copy Markdown
Contributor

Summary:
paperComponentName is a codegenNativeComponent option that makes the generated
view config announce the old-architecture (Paper) RCT-prefixed ViewManager name
instead of the component's own name. We no longer support the old architecture, so
core components should announce their real Fabric names.

Removes the option from the five core specs where it is provably redundant:

Spec Name in view config
ActivityIndicatorViewNativeComponent.js RCTActivityIndicatorView -> ActivityIndicatorView
RCTModalHostViewNativeComponent.js RCTModalHostView -> ModalHostView
PullToRefreshViewNativeComponent.js RCTRefreshControl -> PullToRefreshView
RCTSafeAreaViewNativeComponent.js RCTSafeAreaView -> SafeAreaView
SwitchNativeComponent.js RCTSwitch -> Switch

Each new name already resolves natively, so this is a no-op at runtime:

  • iOS Fabric — the plugin keys in RCTFabricComponentsPlugins.mm and the
    react_fabric_component_plugin_provider entries in BUCK are all unprefixed and
    match the spec names exactly. Previously the RCT prefix was simply stripped again
    by componentNameByReactViewName(), which exists only to undo this legacy prefixing.
  • Android Fabric — mount items carry the C++ descriptor name, not the JS name
    (IntBufferBatchMountItem), so Android is unaffected. ModalHostView still maps via
    FabricNameComponentMapping, and SafeAreaView still resolves to
    ReactSafeAreaViewManager through the generic "RCT$className" fallback in
    ViewManagerRegistry. PullToRefreshView and Switch are Android-excluded.

Deliberately out of scope:

  • The codegen option itself is retained. 24 Meta-internal specs outside
    react-native-github still pass paperComponentName (RCTMapNativeComponent.js,
    SliderNativeComponent.js, the AdsLWI previews, MagicIsland, ...), as do
    third-party OSS libraries. getOptions() does not validate keys, so removing support
    would silently resolve those components to an unregistered name instead of erroring.
  • RCTInputAccessoryViewNativeComponent.js keeps the option, where it is
    load-bearing: the spec name is InputAccessory but the C++ ComponentName is
    InputAccessoryView, so dropping it would fall through to
    RCTUnimplementedViewComponentView. Aligning those needs a rename of the codegen'd
    InputAccessoryProps/InputAccessoryEventEmitter symbols in handwritten C++/ObjC.
  • paperComponentNameDeprecated, which still has 6 internal users.
  • Documentation. The paperComponentName section of the name_mapping.md docs is
    refreshed in a separate diff, so this one touches no Markdown.

Also updates the RCTSwitch fiber-type checks in ReactTreeSerializer.js to accept
Switch, mirroring the existing check in its sibling DebugInteractions.js.

Snapshot churn is the renamed element names only. The RCTRefreshControl entries in
the VirtualizedList/RelayPaginationView snapshots are unchanged because they come
from the hardcoded packages/jest-preset/jest/mocks/RefreshControl.js mock, not from
the view config.

Changelog:

[General][Changed] - Core components (ActivityIndicatorView, ModalHostView, PullToRefreshView, SafeAreaView, Switch) no longer report legacy RCT-prefixed names in their view configs

Differential Revision: D117877024

Summary:
`paperComponentName` is a `codegenNativeComponent` option that makes the generated
view config announce the old-architecture (Paper) `RCT`-prefixed ViewManager name
instead of the component's own name. We no longer support the old architecture, so
core components should announce their real Fabric names.

Removes the option from the five core specs where it is provably redundant:

| Spec | Name in view config |
|---|---|
| `ActivityIndicatorViewNativeComponent.js` | `RCTActivityIndicatorView` -> `ActivityIndicatorView` |
| `RCTModalHostViewNativeComponent.js` | `RCTModalHostView` -> `ModalHostView` |
| `PullToRefreshViewNativeComponent.js` | `RCTRefreshControl` -> `PullToRefreshView` |
| `RCTSafeAreaViewNativeComponent.js` | `RCTSafeAreaView` -> `SafeAreaView` |
| `SwitchNativeComponent.js` | `RCTSwitch` -> `Switch` |

Each new name already resolves natively, so this is a no-op at runtime:

- **iOS Fabric** — the plugin keys in `RCTFabricComponentsPlugins.mm` and the
  `react_fabric_component_plugin_provider` entries in `BUCK` are all unprefixed and
  match the spec names exactly. Previously the `RCT` prefix was simply stripped again
  by `componentNameByReactViewName()`, which exists only to undo this legacy prefixing.
- **Android Fabric** — mount items carry the C++ descriptor name, not the JS name
  (`IntBufferBatchMountItem`), so Android is unaffected. `ModalHostView` still maps via
  `FabricNameComponentMapping`, and `SafeAreaView` still resolves to
  `ReactSafeAreaViewManager` through the generic `"RCT$className"` fallback in
  `ViewManagerRegistry`. `PullToRefreshView` and `Switch` are Android-excluded.

Deliberately out of scope:

- **The codegen option itself is retained.** 24 Meta-internal specs outside
  `react-native-github` still pass `paperComponentName` (`RCTMapNativeComponent.js`,
  `SliderNativeComponent.js`, the `AdsLWI` previews, MagicIsland, ...), as do
  third-party OSS libraries. `getOptions()` does not validate keys, so removing support
  would silently resolve those components to an unregistered name instead of erroring.
- **`RCTInputAccessoryViewNativeComponent.js` keeps the option**, where it is
  load-bearing: the spec name is `InputAccessory` but the C++ `ComponentName` is
  `InputAccessoryView`, so dropping it would fall through to
  `RCTUnimplementedViewComponentView`. Aligning those needs a rename of the codegen'd
  `InputAccessoryProps`/`InputAccessoryEventEmitter` symbols in handwritten C++/ObjC.
- **`paperComponentNameDeprecated`**, which still has 6 internal users.
- **Documentation.** The `paperComponentName` section of the `name_mapping.md` docs is
  refreshed in a separate diff, so this one touches no Markdown.

Also updates the `RCTSwitch` fiber-type checks in `ReactTreeSerializer.js` to accept
`Switch`, mirroring the existing check in its sibling `DebugInteractions.js`.

Snapshot churn is the renamed element names only. The `RCTRefreshControl` entries in
the `VirtualizedList`/`RelayPaginationView` snapshots are unchanged because they come
from the hardcoded `packages/jest-preset/jest/mocks/RefreshControl.js` mock, not from
the view config.

## Changelog:
[General][Changed] - Core components (`ActivityIndicatorView`, `ModalHostView`, `PullToRefreshView`, `SafeAreaView`, `Switch`) no longer report legacy `RCT`-prefixed names in their view configs

Differential Revision: D117877024
@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 Aug 28, 2026
@facebook-github-tools facebook-github-tools Bot added the p: Facebook Partner: Facebook label Aug 28, 2026
@meta-codesync

meta-codesync Bot commented Aug 28, 2026

Copy link
Copy Markdown

@christophpurrer has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117877024.

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. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant