Comments (2)
本工程中,在
/pages/index.js
中使用的是BottomTabNavigator
。
这种方式在我理解看来是App一次性加载完所有的Screen
屏幕内容。
如果:
1.单个Screen
的内容消耗的性能很大(比如3D),这对性能要求就很高。
2.当想从 商品Screen 收藏(Like)一些内容,在 收藏Screen 中展示,这种情况似乎用 ”双页面“ 更好。我的疑问是:
- 为什么这样子设计?
- 如果这样设计不合理,用什么方式改良?
谢谢~
路由不是umi-react-native
这个项目设计和实现的。
umi-react-native
的动机是将umi框架的一些规约,编程**,周边配套的框架、插件等等由web开发嫁接到RN的开发中来。
umi的领域中显而易见只有StackNavigator这一种模型,我在UMIRNExample这个示例工程的/pages/index.js
中用了react-navigation的BottomTabNavigator仅仅是为了演示如何创建底部Tab页切换视图的场景。
至于你所关心的性能问题,可以参看react-navigation的文档或者直接研究它的源码,我没有原生iOS/Android的开发背景,无法深入的阐述。
据我所知react-navigation每种类型的路由,其视图似乎都是一个独立的原生视图,似乎只有当前活动的视图窗口(Activity)享有系统性能的开销,切到后台的视图应该都被系统回收了。如果一定要类比Web开发中的浏览器,react-navigation并不是全都加载到一个页面中,切换视图时在同一个标签页中不断重绘和销毁,而是每次路由到一个Screen都相当于新开了一个标签页窗口。
from umi-react-native.
@xuyuanxiang
谢谢!
from umi-react-native.
Related Issues (10)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umi-react-native.