React Warning: Cannot update a component from inside the function body of a different component

前端 未结 10 1079
攒了一身酷
攒了一身酷 2021-01-01 12:24

I am using Redux with Class Components in React. Having the below two states in Redux store.

{ spinner: false, refresh: false }

In Parent C

10条回答
  •  隐瞒了意图╮
    2021-01-01 12:45

    In my case I had missed the arrow function ()=>{}

    Instead of onDismiss={()=>{/*do something*/}}

    I had it as onDismiss={/*do something*/}

提交回复
热议问题