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

按照此实例搭建,进入路由,在返回,除了首页,其他页面全都为空了 #37

Closed
sunlandong opened this issue Mar 4, 2018 · 19 comments

Comments

@sunlandong
Copy link

在首页里,随意进入一个路由,再次返回,首页,除了首页以外。tab路由的其他路由关联页面都为空了,我运行了你们的项目,也是复现这个问题
image

这是一开始的状态,然后我在首页,点击进入详情,在返回首页,
image

@sunlandong
Copy link
Author

测试发现,是TabNavigator的lazy属性为true就会这样,但是不知道为什么会影响

@nihgwu
Copy link
Owner

nihgwu commented Mar 4, 2018

我记得这是react-navigation本身的问题,升下级应该能解决

@nihgwu nihgwu closed this as completed Mar 4, 2018
@wangxh89
Copy link

wangxh89 commented Mar 6, 2018

@nihgwu 升级了react-navigation 到 1.4.0版本 都没有解决

@nihgwu
Copy link
Owner

nihgwu commented Mar 6, 2018

嗯,我也发现了,不过这个是react-navigation的问题,尝试了下还没解决╮(╯▽╰)╭
https://github.com/react-navigation/react-navigation/issues?utf8=%E2%9C%93&q=blank+screen
react-navigation/redux-helpers#7

@nihgwu nihgwu reopened this Mar 6, 2018
@zhuanglong
Copy link

解决了吗

@sunlandong
Copy link
Author

还是没有解决

@52flutter
Copy link

登录回来 组件会被销毁了

@sunlandong
Copy link
Author

升级到1.5.0依然还是存在问题

@gao520sun
Copy link

有谁解决这问题了吗?

@zhuanglong
Copy link

zhuanglong commented Mar 13, 2018

解决了:
HomeNavigator: { screen: () => <HomeNavigator /> }

@nihgwu
Copy link
Owner

nihgwu commented Mar 13, 2018

@zhuanglong 欢迎 PR 👍

@52flutter
Copy link

@zhuanglong 这样好像又有另一个问题了 就是tab的title没了

@neeboo
Copy link

neeboo commented Mar 13, 2018

@YinRenjie1993 只在StackNavigator里面改就行了, TabNavigator可以不变

@52flutter
Copy link

@neeboo 大佬可以贴代码么 Main: { screen: () => <MainNavigator /> },这么改details点不进去了

@nihgwu
Copy link
Owner

nihgwu commented Mar 13, 2018

感觉都是奇技淫巧,并没有解决实际问题,问题应该是出在了react-navigation-redux-helpers上,据说router不用redux管理就可以了,我暂时没时间看这个问题

@neeboo
Copy link

neeboo commented Mar 14, 2018

@YinRenjie1993 ,是的,貌似在各种嵌套之后就会出现各种问题

@Jeepeng
Copy link

Jeepeng commented Mar 14, 2018

我提交了PR:#39

@sjcUD
Copy link

sjcUD commented Mar 15, 2018

只用在models/router.js 把NavigationActions.COMPLETE_TRANSITION,加到actions[
...
NavigationActions.COMPLETE_TRANSITION,
] 就可以了

@nihgwu
Copy link
Owner

nihgwu commented Mar 15, 2018

@sjcUD 嗯,看了 @Jeepeng 的pr,应该是新的navigation 没有被proxy出去

@nihgwu nihgwu closed this as completed in 83f9623 Mar 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants