React导航中的空白屏幕。 React Native

问题描述 投票:0回答:1

我在React Native上有一个项目,有时当发生错误时,应用程序在React Navigation中走错了路线。因此,我得到了一个空白的白色屏幕,如图所示。

我想将默认页面设为类似于404页面的默认页面。有可能吗?

我可以更改此默认白屏,在其中写点文字并指出链接吗?

提前感谢!

enter image description here

reactjs react-native react-router navigation react-navigation
1个回答
0
投票

您可以将可能导致错误的所有内容包装在try {} catch {}中,然后在catch中导航到错误屏幕。

© www.soinside.com 2019 - 2024. All rights reserved.