Skip to content

fix: fixing MaterialBottomTabNavigator issues #4615

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 8 commits into
base: main
Choose a base branch
from

Conversation

RainPlays09
Copy link

@RainPlays09 RainPlays09 commented Jan 29, 2025

Motivation

I created this PR to fix some issue regarding the MaterialBottomNavigation like Fixing the createMaterialBottomTabNavigator types based on react-navigation@7 because the code is outdated to the example of react-navigation.

@callstack-bot
Copy link

callstack-bot commented Jan 29, 2025

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

@RainPlays09 RainPlays09 marked this pull request as draft February 21, 2025 00:55
@RainPlays09 RainPlays09 marked this pull request as ready for review February 21, 2025 00:55
@RainPlays09 RainPlays09 changed the title refactor: change createMaterialBottomTabNavigator types based on react-navigation@7 fix: change createMaterialBottomTabNavigator types based on react-navigation@7 Feb 21, 2025
@RainPlays09
Copy link
Author

@BogiKay Could you review my PR??

@BogiKay
Copy link
Contributor

BogiKay commented Apr 17, 2025

Hey @RainPlays09, sorry for the delay. I checked your PR and when it comes to the types it looks fine. My only concern is that MaterialBottomTabView.tsx still doesn't support v7 for web.

If you update react-navigation to v7 in the example app and run web app, then you'll get an error Uncaught TypeError: buildLink is not a function, so it should be taken care of as well. I believe it can be partially reused after adjustment what was reverted in this PR.

Something like example below should fix the problem. I didn't test it yet, just wanted to visualise what can be done to fix v7 in web apps and to provide temporarily backward compatibility for users that haven't yet migrated to v7.

export const useBackwardCompatibleLinkBuilder = () => {
  const builder = useLinkBuilder();

  if (typeof builder === 'function') {
    return builder;
  } else {
    return builder.buildHref;
  }
};

Share your thoughts on it and let me know if I can help you.

@RainPlays09 RainPlays09 reopened this Apr 17, 2025
@RainPlays09 RainPlays09 deleted the fix-react-navigation branch April 17, 2025 14:14
@RainPlays09 RainPlays09 restored the fix-react-navigation branch April 17, 2025 14:15
@RainPlays09 RainPlays09 reopened this Apr 17, 2025
@RainPlays09 RainPlays09 changed the title fix: change createMaterialBottomTabNavigator types based on react-navigation@7 fix: fixing MaterialBottomTabNavigator issues Apr 17, 2025
@RainPlays09
Copy link
Author

Hello @BogiKay, I'm sorry to any unattended action regarding this PR, I'm still learning regarding git commands. So I try your suggestion regarding the useLinkBuilder, can you test if this is working?? thank you very much

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.

3 participants