我开始学习React的优化。并看到一些学习资源,在它们上,我可以在探查器中看到组件道具。但在我的 Profiler 中,我没有看到任何道具。为什么?
如何在 Profiler 中查看当前渲染组件的 props?
A make screenshots to show this:
旧版 DevTools 扩展增加了显着的性能开销,并且在大型应用程序中将变得无法使用。新的 DevTools 得到了改进 https://github.com/facebook/react/blob/master/packages/react-devtools/CHANGELOG.md#400-august-15-2019通过最小化前端(您看到的扩展:Component、Profiler)和后端之间的通信,仅在需要时呈现组件信息。
The Props changed in the Profiler is still there, however it's not as detailed. It lacks displaying names of custom Hooks https://github.com/facebook/react/blob/master/packages/react-devtools/OVERVIEW.md#inspecting-hooks. It does show prop names but only the ones that changed and doesn't show their values.
不幸的是,变更日志没有明确列出它放弃了显示道具值的支持,并且应该对此更加清楚。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)