Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-navigating back to the same screen does not reload state #3

Open
housseindjirdeh opened this issue Jul 10, 2017 · 1 comment
Open
Labels
Projects

Comments

@housseindjirdeh
Copy link
Member

Since the app has nested navigation throughout, most of the screens can be accessed through each of the tabs. Moreover, the same screen can easily be accessed in the same stack.

To reproduce this bug, there are 2 ways:

1

  1. In any tab, navigate to any screen (for example: user profile)
  2. Switch to a different tab, navigate to the same screen (for example: user profile for a different user)
  3. Switch back the first tab and you'll notice that the correct state isn't shown

2

  1. navigate to repository screen (as an example)
  2. click any contributor to navigate to user profile screen
  3. click number of repos to navigate to repository list screen
  4. click a repository to navigate to the repository screen
  5. go back multiple times until you reach the first repository screen you accesed -- you'll notice that the correct state isn't shown

This can be solved by essentially reloading component state whenever it comes into focus and there's an issue open for that in React Navigation.

One thing I've tried is wrapping a HOC in the meantime that exposes a isFocused prop, but I couldn't have this working without the component state being fired multiple times every time the screen was focused.

Open to suggestions of any kind!

@machour
Copy link
Member

machour commented Mar 27, 2018

This will soon be totally fixed by the new redux middleware 🎉

Can already be verified by opening starred repositories for different users in all 4 tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Roadmap
Release 1.3
Development

No branches or pull requests

2 participants