Skip to content
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

In Jest environment, header of native-stack modal is rendered twice #2569

Closed
thomasttvo opened this issue Dec 10, 2024 · 3 comments
Closed
Labels
Close when stale This issue is going to be closed when there is no activity for a while Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS

Comments

@thomasttvo
Copy link

thomasttvo commented Dec 10, 2024

Description

In NativeStackView.native.tsx, the SceneView renders both the header and MaybeNestedStack, and then MaybeNestedStack checks if it's a modal, then renders the header again inside. This might be ok in real-life because we're resolving these header configs in the native world, but in Jest they just got rendered as regular components and can be duplicated.

Steps to reproduce

Open a modal route in jest, then check the tree.

Snack or a link to a repository

Screens version

3.34.0

React Native version

0.73.5

Platforms

Android, iOS

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@github-actions github-actions bot added Missing repro This issue need minimum repro scenario Missing info The user didn't precise the problem enough labels Dec 10, 2024
Copy link

github-actions bot commented Dec 10, 2024

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or a link to a repository section.

@github-actions github-actions bot added Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS labels Dec 10, 2024
@kkafar
Copy link
Member

kkafar commented Dec 11, 2024

@thomasttvo thanks for reporting. What would be the expected behaviour in your opinion? And could you describe what problem it leads to? My initial impression is that we won't want to change anything here, because we would have to manipulate the view hierarchy only for test purposes - what I'm not sure makes much sense. The "duplicated header element" you get in tests is what is actually rendered in React Element Tree in production also

@kkafar kkafar added the Close when stale This issue is going to be closed when there is no activity for a while label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Close when stale This issue is going to be closed when there is no activity for a while Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS
Projects
None yet
Development

No branches or pull requests

2 participants