Commit b58e5fa
Summary:
Hello, I work on [Radon IDE](ide.swmansion.com) I encountered an issue while adding support for react native 81, this PR solves it:
In #51023 EvanBacon removed `displayName` filed from `View` component adding the following comment:
>Remove displayName in favor of component name. I'm not 100% sure this is a full fallback but it is valid according to react/display-name eslint rule—https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md
Unfortunately the Fabric renderer uses the `displayName` property to generate the name of the component for the inspector functionality and in absence of it generates a name that might be confusing to the end user:
<img width="351" height="283" alt="Screenshot 2025-07-17 at 21 27 37" src="https://github.com/user-attachments/assets/852246aa-6586-4684-b80e-5d70b9678c6e" />
Problem is not specific to Radon and happens in chrome devtools as well:
<img width="501" height="130" alt="Screenshot 2025-07-17 at 22 16 52" src="https://github.com/user-attachments/assets/3514dd02-59f7-473a-87b1-6ed325d2034c" />
This PR brings back the `displayName` property to fix that.
[INTERNAL] [FIXED] - Bring back the displayName property to the View component
Pull Request resolved: #52688
Test Plan:
- Run the application
- open chrome devtools and navigate to "components" tab
- before changes the View components would show up as `View_withRef` after they are named `View`
Rollback Plan:
Reviewed By: lunaleaps, cortinico
Differential Revision: D78512254
Pulled By: alanleedev
fbshipit-source-id: 46e4a224b09fe3fb938c055a675f687c86d7ddcb
Co-authored-by: filip131311 <159789821+filip131311@users.noreply.github.com>
1 parent 2e52c1a commit b58e5fa
File tree
2 files changed
+10
-4
lines changed- packages/react-native
- Libraries/Components/View
2 files changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
562 | 563 | | |
563 | 564 | | |
564 | 565 | | |
| |||
5622 | 5623 | | |
5623 | 5624 | | |
5624 | 5625 | | |
5625 | | - | |
| 5626 | + | |
| 5627 | + | |
5626 | 5628 | | |
5627 | 5629 | | |
5628 | 5630 | | |
| |||
6166 | 6168 | | |
6167 | 6169 | | |
6168 | 6170 | | |
6169 | | - | |
| 6171 | + | |
6170 | 6172 | | |
6171 | 6173 | | |
6172 | 6174 | | |
| |||
0 commit comments