Skip to content

fix: View component does not have a displayName #52688

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

filip131311
Copy link

@filip131311 filip131311 commented Jul 17, 2025

Summary:

Hello, I work on Radon IDE 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 resulting and in absence of it generates a name that might be confusing to the end user:

Screenshot 2025-07-17 at 21 27 37

Problem is not specific to Radon and happens in chrome devtools as well:

Screenshot 2025-07-17 at 22 16 52

This PR brings back the displayName property to fix that.

Changelog:

[INTERNAL] [FIXED] - Bring back the displayName property to the View component

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

@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 Jul 17, 2025
@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jul 17, 2025
@facebook-github-bot
Copy link
Contributor

@alanleedev has imported this pull request. If you are a Meta employee, you can view this in D78512254.

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. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants