mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
fix loading (#8571)
This commit is contained in:
parent
8f1fd4d68b
commit
d825e27667
@ -33,7 +33,7 @@ class UserRemoteSelect extends React.Component {
|
||||
console.log('fetching user', value);
|
||||
this.lastFetchId += 1;
|
||||
const fetchId = this.lastFetchId;
|
||||
this.setState({ fetching: true });
|
||||
this.setState({ data: [], fetching: true });
|
||||
fetch('https://randomuser.me/api/?results=5')
|
||||
.then(response => response.json())
|
||||
.then((body) => {
|
||||
@ -43,9 +43,8 @@ class UserRemoteSelect extends React.Component {
|
||||
const data = body.results.map(user => ({
|
||||
text: `${user.name.first} ${user.name.last}`,
|
||||
value: user.login.username,
|
||||
fetching: false,
|
||||
}));
|
||||
this.setState({ data });
|
||||
this.setState({ data, fetching: false });
|
||||
});
|
||||
}
|
||||
handleChange = (value) => {
|
||||
|
Loading…
Reference in New Issue
Block a user