We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
下图是使用react-router 构建的项目,在 Chrome 的 Performance 下 观察到的初始渲染所需要的时间: )
跳转每个界面,渲染react-router 组件都需要浪费50%以上的时间。
对于react 16.0 以上的版本,react-tools 添加了 Profiler 项。在页面更新时,变化部分会有彩色的框框。如下:
通过分析我们知道,在切换「积分排名」和「积分明细」时, 其实上部分是没有必要变化的。 虽然 react 有 VDom ,但是尽量避免非要的更新对于复杂的项目还是有很大的好处的。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
使用生产版本
尽量使用单页应用
下图是使用react-router 构建的项目,在 Chrome 的 Performance 下 观察到的初始渲染所需要的时间:
)
跳转每个界面,渲染react-router 组件都需要浪费50%以上的时间。
使用react-tools
对于react 16.0 以上的版本,react-tools 添加了 Profiler 项。在页面更新时,变化部分会有彩色的框框。如下:
通过分析我们知道,在切换「积分排名」和「积分明细」时, 其实上部分是没有必要变化的。 虽然 react 有 VDom ,但是尽量避免非要的更新对于复杂的项目还是有很大的好处的。
The text was updated successfully, but these errors were encountered: