ex-navigation
ex-navigation copied to clipboard
Re-render on tab switch.
Hi, I'm fairly new to React-Native but this library has already been awesome to work with. I've gotten the TabNavigation working with each tab with its own StackNavigation. I would like to re-render each time I press on the a tab. For example, if I have tabs Home, Posts, and Profiles, if I press on any, it will re-render the content. How can I implement this ? Let me know if I should post a code snippet of what I've got so far. If this isn't doable right now, I would love to contribute to get this working !
I've had this PR pending since October. Would like to have some comment on it. :)
https://github.com/exponentjs/ex-navigation/pull/163
Doesn't the lazy
prop handle this? e.g. <TabNavigation lazy />
Wrong button. @JulianKingman the lazy prop only works for the sliding tab.
@arthur-tse7 how did you manage to solve this? I want to execute some code to fetch from an http API, everytime a tab is selected. I have tried a lot and still have no idea
@hecontreraso I didn't. I misclicked 'Close and comment'. The solution that Julian suggested only works for the SlidingTabBar.
The react-native-tab-view
also mentions using the navigationState
prop for this. I'm not sure how to do it, read on here: https://github.com/react-native-community/react-native-tab-view#caveats