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

Fix/bottom nav use href react 7 #4644

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

Conversation

wtvamp
Copy link

@wtvamp wtvamp commented Mar 3, 2025

Motivation

Currently, the Bottom Tab Navigator (react-native-paper/react-navigation) cannot be used with the latest version of react-navigation (7.x) or with the latest expo-router due to changes in the react-navigation API. The issue is that useLinkBuilder now returns an object instead of a builder function.

Related issue

#4601

Test plan

Ran lint, tslint, and tests - in relation to changes, fixed all errors and all passing. There are errors in other components in main that currently don't pass.

Tested with yarn example start and yarn example web

This pull request includes updates to dependencies and improvements to the MaterialBottomTabView component in the src/react-navigation/views directory. The most important changes are grouped into dependency updates and component enhancements.

Dependency Updates:

  • Updated @react-navigation/native to version ^7.0.15 in package.json.

Component Enhancements:

  • Added ColorValue import from react-native in MaterialBottomTabView.tsx.
  • Introduced a new RenderTouchableProps type to improve type safety for the renderTouchable function.
  • Refactored the renderTouchable function to use buildHref instead of buildLink and ensured rippleColor is applied correctly.
  • Simplified the getLabelText function to use the nullish coalescing operator for better readability.
  • Reformatted the onTabLongPress function for better code readability.

@callstack-bot
Copy link

Hey @wtvamp, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

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

Successfully merging this pull request may close these issues.

2 participants