我是第一次使用React并尝试使用React Hooks,但我遇到了错误。我不能找出哪一行代码导致了无限循环,就像在控制台中说的那样 Too many re-renders.React limits the number of renders to prevent an infinite loop
The above error occurred in the <ProcessingInvoiceScreenProcessingInvoi
componentDidUpdate首先记录一个空对象,然后更新not required,这会记录它们两次,并显示props is not defined如何测试componentDidUpdate而不进入循环this.anotherFunc(); console.log("update not required") } 我尝试使用await expect(callBackFalse).toHaveBeenCalledWith(prevProps