react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Custom React component for bottom tabs

Open zabojad opened this issue 1 year ago • 4 comments

🚀 Feature

We already have the possibility to have a custom React component as TopBar which is cool and a very common use case in my opinion.

Another very common use case would be to use a custom React component as bottom tabs. It could be done in a similar way that the React Navigation lib is offering this feature, ie: give the possibility to the user to build its own bottom tabs component that would receive via its props the information about current index, etc...

Motivation

The current Bottom tabs component is nice but does not offer enough customization to be widely adopted. We already have the possibility to use a custom react component as TopBar, we could have the same for the BottomTabs...

Pitch

We should have the same as for the TopBar, ie:

In the RNN options, we specify:

Navigation.setDefaultOptions({
  topBar: {
    title: {
      component: { name: 'MyTopBar' }
    }
  }
});

We should also be able to do this:

Navigation.setDefaultOptions({
  bottomTabs: {
    component: { name: 'MyBottomTabs' }
  }
});

Then, the custom component should receive via its props the information about the tabs labels, pictures, etc... and the current index.

Are you willing to resolve this issue by submitting a Pull Request?

Yes, I have the time, but I don't know how to start. I would need a lot of guidance.

zabojad avatar Aug 24 '22 15:08 zabojad

@guyca Sorry to disturb but could you give me some guidance so that I implement it?

zabojad avatar Aug 29 '22 10:08 zabojad

Same issue here.

geroale avatar Oct 28 '22 07:10 geroale

Any possible update on this by any chance?

kkovax25 avatar Aug 22 '23 12:08 kkovax25

@zabojad This is very good example that how React Navigation lib implements it. Will RNN library support this feature? https://stackoverflow.com/questions/62052506/navigate-to-the-screen-when-tab-on-bottomtabnavigator-is-pressed

hellforever avatar Nov 08 '23 21:11 hellforever