为什么可以使用React DevTools更改状态?
我希望能够使用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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您选择了包含要更改状态的组件,在屏幕截图中选择的组件中没有状态。如果状态属性没有复选框,则可以选择值,输入一个新值,然后按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.