React navigation — call screen method on tab bar press

  • Call a screen function when the screen is focused
  • Call a screen function when the navigation tab is pressed

Call a screen function when the screen is focused

Register screen focus listener, onScreenFocus() called when the screen is focused initially

Call a screen function when the navigation tab is pressed

Call tabOnTabNavigator function when the screen is focused and the tab bar is pressed
tapOnTabNavigator will be called when the screen is focused and our tab is pressed

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dejan Blazeski

Dejan Blazeski

Founder binge.app. Curious dev. Laravel / Angular / VueJs / React Native / Docker. Love stand up shows.