为什么可以使用React DevTools更改状态?

发布于 2025-01-24 20:58:32 字数 320 浏览 3 评论 0原文

我希望能够使用React DevTools在React应用中更改状态,例如,设置已加载 false而不是true。我无法编辑该值。在Localhost和Live Web应用程序上都是如此。为什么一些布尔值有一个复选框而其他值不存在?

I want to be able to change state in a React app using React devtools, for example, setting loaded to false instead of true. I am not able to edit the value. This is true both on localhost and on the live web app. Why do some boolean values have a checkbox and others don't?
enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只为一人 2025-01-31 20:58:32

确保您选择了包含要更改状态的组件,在屏幕截图中选择的组件中没有状态。如果状态属性没有复选框,则可以选择值,输入一个新值,然后按Enter或单击,然后将其更新。

Make sure you have selected the component containing the state you wish to alter, there is no state in the component selected in the screenshot. If the state property does not have a checkbox you can select the value, input a new value, then hit enter or click away and it will update.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文