Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

[Question] Tab focus : access inner screen ? #3

Open
Freddy03h opened this issue Mar 13, 2017 · 0 comments
Open

[Question] Tab focus : access inner screen ? #3

Freddy03h opened this issue Mar 13, 2017 · 0 comments

Comments

@Freddy03h
Copy link

Hi ! First, thank's for all your works about navigation with react-native!

react-navigation is a very cool project, I used NavigationExperimental before and it was easy to switch.
With this addons project, I think you really identified problems a developper can encounter with react-navigation.

I've got a focus / fetch issue with my app:
I have a TabNavigator with 4 tabs and each of them got a separate StackNavigator. By implementing addEventListener with focus event on the Stack, I can now re-fetch data when StackNavigator is back to root screen. That's great!

But I can't figure how to re-fetch data when Tab's focus event appear. In the component that instantiate the StackNavigator, I can receive the TabNavigator focus event, but I don't know how to access the screen created by the StackNavigator to call the fetch method. And I'm not sure if that's the good approach.

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

No branches or pull requests

1 participant