我已经创建了一个处于React状态的对象的状态,但是我需要将另一个对象增加到相同的状态。但是,我不能使用setState()属性,因为它会导致重呈现(无限循环)。personalData: { alias: '', }错误:
TooReact limits the number of renders t
每次运行应用程序:Too many re-renders.React limits the number of renders to prevent an infinite loop.时,我都会收到这样的错误消息import { Table } from 'semantic-ui-react';
import Moment from're
我是第一次使用React并尝试使用React Hooks,但我遇到了错误。我不能找出哪一行代码导致了无限循环,就像在控制台中说的那样 Too many re-renders.React limits the number of renders to prevent an infinite loop
The above error occurred in the <ProcessingInvoiceScreenProcessingInvoiceScreen
在调用re-render()函数之前,是否可以使用react准备一个变量以在JSX中显示?count_function() { // const count = this.count_function() // This can't be put in state, otherwise 'infinite-loopreturn ( {count}
</d
问题是钩子的主体被渲染了6次。因此,当我尝试使用自定义钩子(UseFetchData)返回的数据在上下文文件中进行setState时,我得到了错误- " error : Too - many - renders .React限制呈现的次数以防止无限循环“。我认为某些状态更改会导致它重新呈现。context.js import React, { useState, createContext } from "react";
import us