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

前端 未结 10 1130
攒了一身酷
攒了一身酷 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:39

    I had same issue after upgrading react and react native, i just solved that issue by putting my props.navigation.setOptions to in useEffect. If someone is facing same problen that i had i just want to suggest him put your state changing or whatever inside useEffect

提交回复
热议问题