简体   繁体   English

为什么反应开发工具 Profiler 不显示组件道具?

[英]Why react dev tools Profiler dont show me component props?

I start to learn optimization of React.我开始学习 React 的优化。 And see some learning resources, and on them, I can see component props in the Profiler.并查看一些学习资源,在它们上面,我可以看到 Profiler 中的组件道具。 But in my Profiler, I don't see any props.但是在我的 Profiler 中,我没有看到任何道具。 Why?为什么?

And how can I see a current render component props in Profiler?以及如何在 Profiler 中查看当前的渲染组件道具?

A make screenshots to show this:制作屏幕截图来显示这一点: 在此处输入图像描述

The Legacy DevTools extension added a significant performance overhead and would be become unusable in large apps. Legacy DevTools 扩展增加了显着的性能开销,并且在大型应用程序中将变得无法使用。 The new DevTools improved by minimizing communication between the front end(the extension you see: Component, Profiler) and back end, which render component information only when needed. 新的 DevTools通过最小化前端(您看到的扩展:Component、Profiler)和后端之间的通信进行了改进,它们仅在需要时呈现组件信息。

The Props changed in the Profiler is still there, however it's not as detailed. Profiler 中更改的 Props 仍然存在,但没有那么详细。 It lacks displaying names of custom Hooks .它缺少自定义 Hooks 的显示名称 It does show prop names but only the ones that changed and doesn't show their values.它确实显示了道具名称,但仅显示了更改的名称并且不显示它们的值。 在此处输入图像描述

The Changelog unfortunately doesn't explicitly list that it dropped support to display prop values and should've been more clear on that.不幸的是,Changelog 没有明确列出它放弃了对显示道具值的支持,并且应该更清楚地说明这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM