About the problem of reactjs warning with an endless loop

warning prompt:
Cannot update during an existing state transition (such as within render or another component"s constructor). Render methods should be a pure function of props and state; constructor side-effects are an anti-pattern, but can be moved to componentWillMount .

Click the query button to request the API to obtain the form data, and then setState renders it to the last page of Table,. After that, the browser console displays a bunch of warnings of endless loop prompts, until the memory overflow browser page crashes
has passed the solution and solved it according to their method. Finally, it will not work

.
fetchDatas = () => {
  ...
  this.setState({columns, dataSource: content});
}


<Button type="primary"  onClick={()=>{this.fetchDatas()}}></Button>

<Table loading={loading} onRow={this.onRow} rowKey={(record, index) => index} dataSource={dataSource} columns={columns} pagination={false} scroll={{x: 1000, y: 500}} />
Jan.11,2022

setState does not guarantee Synchronize, Synchronize, or Synchronize. Say the important thing three times, and the landlord can find the reason according to this


antd is really a bit of a pit. The browser console prompts that onRowClick, is not recommended. OnRow, is recommended. After I used onRow, there was a bunch of warnings of an endless loop until the browser crashed, and then it was normal to change onRow back to onRowClick

.
Warning: onRowClick is deprecated, please use onRow instead.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3d7ef-2bbe5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3d7ef-2bbe5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?