我假设包react-virtual-list在使用VirtualList
时调用setState
,但这不应该导致componentDidMount
内部的问题吧?为什么在ComponentDidMount中调用setState会导致错误?
Can only update a mounted or mounting component. This usually means you called setState() on an unmounted component. This is a no-op. Please check the code for the vlist component.
componentDidMount =() => { this.MyVirtualList = VirtualList({container: this._itemsList})(this.MyList) }
你能发布组成你的组件的代码吗? – djfdev
什么是'''this.MyVirtualList'''?这是一个功能?请展示更多代码。 –