Commit d6d7bc2
Stop using
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: D117877024paperComponentName in React Native core component specs1 parent c6b137c commit d6d7bc2
6 files changed
Lines changed: 6 additions & 13 deletions
File tree
- packages/react-native
- Libraries/LogBox/__tests__/__snapshots__
- src/private/components
- activityindicator/specs
- modal/specs
- refreshcontrol/specs
- safeareaview/specs
- switch/specs
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
| 116 | + | |
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
230 | | - | |
| 230 | + | |
231 | 231 | | |
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | 53 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
150 | 149 | | |
151 | 150 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
63 | 62 | | |
64 | 63 | | |
65 | 64 | | |
0 commit comments