我在React Native上有一个项目,有时当发生错误时,应用程序在React Navigation中走错了路线。因此,我得到了一个空白的白色屏幕,如图所示。
我想将默认页面设为类似于404页面的默认页面。有可能吗?
我可以更改此默认白屏,在其中写点文字并指出链接吗?
提前感谢!
您可以将可能导致错误的所有内容包装在try {} catch {}中,然后在catch中导航到错误屏幕。
try {} catch {}
catch