Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Update default Tab index #114

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

mustafaskyer
Copy link

I have many routes
[likes, search, home, profile, settings]
and suggest making the default route to be in the middle,
or we can add defaultTab prop into tabs property which should be the default
regards

I have many routes 
[likes, search, home, profile, settings]
and suggest making the default  route to be in the middle,
or we can add defaultTab prop into tabs property which should be the default
regards
@timomeh
Copy link
Owner

timomeh commented Dec 20, 2018

Thank you very much for your contribution!

Setting it to the middle tab seems too specific for your use case. But adding the defaultTabIndex prop as you suggested sounds good. The same thing was already discussed in #102 (comment). It would be great if you could implement defaultTabIndex.

Bonus points if no tab would be active if the defaultTabIndex prop isn't set. 🙂 This would finally resolve #102

Added defaultTabIndex property, if exist respectively will be the default tab, otherwise, the default is the first index of tabsdefaultTabIndex should pass as a prop to , like so
<BottomNavigation defaultTabIndex={2} ... />
regards
@mustafaskyer
Copy link
Author

thanks, @timomeh
commit updated :),
now expects defaultTabIndex,
regards

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

Successfully merging this pull request may close these issues.

2 participants