8000 tabBarButtonTestID is set on 2 Pressables in the hierarchy · Issue #12597 · react-navigation/react-navigation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

tabBarButtonTestID is set on 2 Pressables in the hierarchy #12597

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
4 of 13 tasks
a-klotz-p8 opened this issue May 15, 2025 · 2 comments
Open
4 of 13 tasks

tabBarButtonTestID is set on 2 Pressables in the hierarchy #12597

a-klotz-p8 opened this issue May 15, 2025 · 2 comments

Comments

@a-klotz-p8
Copy link
a-klotz-p8 commented May 15, 2025

Current behavior

Currently when using the following in the screenOptions of a Tab.Navigator:

          tabBarButtonTestID: `tabButton-${route.name}`,
          tabBarButton: ({android_ripple, ...rest}) => <Pressable {...rest} />,

you get two nested Pressables with the same testID.

Expected behavior

Only one of the Pressables should contain the testID that is specified

Reproduction

snack reproduction

Platform

  • Android
  • iOS
  • Web
  • Windows
  • MacOS

Packages

  • @react-navigation/bottom-tabs
  • @react-navigation/drawer
  • @react-navigation/material-top-tabs
  • @react-navigation/stack
  • @react-navigation/native-stack
  • react-native-drawer-layout
  • react-native-tab-view

Environment

  • I've removed the packages that I don't use
package version
@react-navigation/native ^7.0.15
@react-navigation/bottom-tabs ^7.2.1
@react-navigation/native-stack ^7.2.1
react-native-screens ^4.9.1
react-native-safe-area-context 5.3.0
react-native-gesture-handler 2.24.0
react-native-reanimated ^3.17.1
react-native 0.78.0
node ≥18
npm or yarn npm
@a-klotz-p8 a-klotz-p8 added the bug label May 15, 2025
Copy link

Hey @a-klotz-p8! Thanks for opening the issue. It seems that the issue doesn't contain a link to a repro, or the provided repro is not valid (e.g. broken link, private repo, code doesn't run etc.).

The best way to get attention to your issue is to provide an easy way for a developer to reproduce the issue.

You can provide a repro using any of the following:

A snack link is preferred since it's the easiest way to both create and share a repro. If it's not possible to create a repro using a snack, link to a GitHub repo under your username is a good alternative. Don't link to a branch or specific file etc. as it won't be detected.

Try to keep the repro as small as possible by narrowing down the minimal amount of code needed to reproduce the issue. Don't link to your entire project or a project containing code unrelated to the issue. See "How to create a Minimal, Reproducible Example" for more information.

You can edit your original issue to include a link to the repro, or leave it as a comment. The issue will be closed automatically after a while if you don't provide a valid repro.

Copy link

The versions mentioned in the issue for the following packages differ from the latest versions on npm:

  • @react-navigation/native (found: 7.0.15, latest: 7.1.9)
  • @react-navigation/bottom-tabs (found: 7.2.1, latest: 7.3.13)

Can you verify that the issue still exists after upgrading to the latest versions of these packages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0