我目前正在开发一个中等规模的ReactJS应用程序,在单击组件上的按钮后,会收到以下错误消息:
Warning: setState(...): Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op.
我该如何更轻松地调试?为什么ReactJS没有给出违反此规则的具体组件名称?
你会怎么做?
componentDidMount
中,因为内部回调可能在组件已经卸载后执行。 - WiredPrairie