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

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

@Freddy03h

Description

@Freddy03h

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions