When use ComponentDidMount() I found this error : Can't call setState

前端 未结 3 1934
慢半拍i
慢半拍i 2020-12-20 10:22

I found this error :

Can\'t call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your applica

3条回答
  •  时光取名叫无心
    2020-12-20 10:30

    You're doing an asynchronous action (loadEntityNameById) that sets the state for the component when it finishes. By that time, your Breadcrumbs component may have been unmounted, and the error is thrown.

提交回复
热议问题