Skip to content

Commit ce9f991

Browse files
author
Wonday
committed
wrapper setState with setTimeout;
1 parent fb6422f commit ce9f991

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ export default class CachedImage extends Component {
135135
}, (error) => {
136136
// cache failed use original source
137137
if (this._mounted) {
138-
this.setState({source: this.props.source});
138+
setTimeout(() => {
139+
this.setState({source: this.props.source});
140+
}, 0);
139141
}
140142
this._downloading = false;
141143
});

0 commit comments

Comments
 (0)