[英]React-Navigation performance: How many screens are too many?
I am new to both Recact Native and React-Navigation. The app I am planning is super content heavy.我是 React Native 和 React-Navigation 的新手。我正在计划的应用程序内容非常丰富。 It will have several hundred unqique screens.
它将有数百个独特的屏幕。 I want to connect them via React-Navigation so my stack is going to be quiet large.
我想通过 React-Navigation 连接它们,这样我的堆栈就会非常大。 Is there an issue with that performance wise or anything I should keep in mind?
该性能是否有问题或我应该记住什么? My guess is that a screen is only loaded when the user is accessing it for the first time, so the initial loading time of the app should not be affected?
我的猜测是只有当用户第一次访问时才会加载屏幕,所以应用程序的初始加载时间应该不会受到影响?
Thanks!谢谢!
Actually it doesn't matter how may js files are you creating but it matters when you are:实际上,创建 js 文件的数量并不重要,但在以下情况下很重要:
3)Try to use FastImage instead of image when you want to show images using FlatList, Map etc. In short if images in a single screen is render more than twice. 3)FlatList、Map等图片展示时,尽量使用FastImage代替image
Note: At Last i want to say that you can create as much as JS files but it must be reusable, not unnecessary and no repeated code there.注意:最后我想说的是,你可以创建尽可能多的 JS 文件,但它必须是可重用的,不是不必要的,也没有重复的代码。
You can also consider this as a performance improvement.您也可以将此视为性能改进。
You have a screen.你有一个屏幕。 When you push or navigate a new screen on it.
当您在其上按下或导航新屏幕时。 You can stop the animations in the background screen.
您可以停止背景屏幕中的动画。 Because the screen in the back continues to work.
因为后面的屏幕继续工作。 So you can stop animating the background screen.
所以你可以停止动画背景屏幕。
For example, you have a slider component in the home screen and.例如,您在主屏幕和中有一个 slider 组件。 This slider autoplay feature is active.
此 slider 自动播放功能处于活动状态。 When you change the home screen you can stop the autoplay feature.
当您更改主屏幕时,您可以停止自动播放功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.