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}} />