Search code examples
androidreact-nativereact-navigationbottomnavigationview

How to update adjacent tab from a BottomTabNavigator tab in React native


Im using react-navigation for react native. I have three screens inside a bottomtabnavigator. One of them contains a location picker(for eg.). I want to update the location details in the two other pages too whenever user picks a new location. How can i listen for location change from adjacent tabs?


Solution

  • Ok. I started using contex api to achive this. The update code is written common in the provider and Updates are made by calling from the children wrapped by Consumer.