I'm new to react native and trying to design a custom Bottom navigation bar as shown here (Source code)
The tab bar design is successfully created, but I am confused about how to change screens on button click. Basically, I cannot understand how to connect the React Native Navigation Component to this custom bottom tab bar.
I'm looking forward to using React navigation custom navbar support... but not sure how to implement the same.
Please help.
Thanks in advance.
React Navigation Docs are really helpful. Check out my solution here.
The solution is to just add a reference of the custom tab bar design in the usual navigator definition and pass the state, descriptors, navigation props from the Navigator to the custom design as shown below.
/components/BottomBar/index.js: Define the navigation model and use Tabbar as custom design.
/components/BottomBar/TabBar.js: Pass the navigator props to the static tab bar along with the custom icon details.
/components/BottomBar/StaticTabbar.js: Using the props display the items in the tab bar