react native invariant violation: Maximum update depth exceeded.This can happen when a component rep

 

这个原因是在render中使用了setState,导致了重复刷新,render函数死循环了。

如果生成的控件的componentDidMount等加载时运行的函数中含有setState,那么也不能在render中生成这个控件,而要在

componentWillMount中生成这个控件,否则也会造成死循环。

相关文章:

  • 2021-12-01
  • 2021-09-08
  • 2021-10-10
  • 2022-12-23
  • 2021-10-28
  • 2021-09-01
  • 2021-12-14
  • 2022-12-23
猜你喜欢
  • 2021-05-20
  • 2022-02-26
  • 2021-09-02
  • 2022-12-23
  • 2022-01-17
  • 2022-12-23
  • 2021-07-26
相关资源
相似解决方案