简体   繁体   English

是什么导致 React 中出现“太多重新渲染”错误?

[英]What causes "Too many re-renders" error in React?

Many times this error is occurring in my project.很多时候这个错误发生在我的项目中。 When facing this error, I just delete my code.遇到这个错误时,我只是删除了我的代码。 I'm not understanding why this error would happen.我不明白为什么会发生此错误。

Probably, the each render you are updating the state and it causes infinite re-render.可能,您正在更新 state 的每个渲染都会导致无限重新渲染。 We could help you if you will share your code.如果您愿意分享您的代码,我们可以帮助您。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM