-
Notifications
You must be signed in to change notification settings - Fork 24.9k
fix: restore View display name #52622
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
fix: restore View display name #52622
Conversation
|
re danger not about "BREAKING": this PR restores the state from before #51023, which will only be publish with RN 0.81, therefore should not be considered breaking |
How did you determine #51023 to be the root cause? I would expect #52018 to have caused this, because it migrates The ideal fix for this is to configure I wonder if we need to set it here in |
Are you able to check whether #52625 resolves the issue for you? |
@yungsters I've checked the #52625 but it still renders Re root cause:
|
6197ecb
to
0267d51
Compare
As mentioned in my previous comment, #51023 did not cause this. A component implemented as a named function will use that name in snapshot tests. The Can you tell me how to reproduce this? The root cause is that |
As mentioned in my previous reply, setting I've prepared a minimal repro showcasing that:
As additional context I will mention that non of the other components ( @yungsters please advise. |
0267d51
to
97bb21a
Compare
97bb21a
to
cd7ab70
Compare
Closing as essentially same fix (restoring |
Summary:
Resolves #52764
When checking React Native Testing Library support for RN 0.81 I've noticed that all snapshot tests that rendered
<View />
rendered it<View_withRef>
.This change break both RN Testing Library simulation layer (could be fixed if needed), and will also affect any users using snapshot testing to test their components.
I've traced this change to #51023 which removed:
- View.displayName = 'View';
This PR restores
displayName
in order to preserver the snapshot stability.Note most other built-in components declare
displayName
:Changelog:
Test Plan: