gitpoint / gitpoint/git-point

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

未关闭
#3 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
:bug: bug
主要语言
JavaScript
星标
4.8k
派生
771
PR 合并指标
30 天内没有已合并 PR

描述

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](https://github.com/react-community/react-navigation/issues/51) 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!

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。