Skip to content

Commit a27f8be

Browse files
drop outdated body before fetching new one
1 parent 3ee3f7d commit a27f8be

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## react-coroutine v0.4.0
2+
3+
* Drop outdated body before fetching new one
4+
15
## react-coroutine v0.3.2
26

37
* Fixed incorrect props comparison

modules/Coroutine.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ function create(asyncFn, getVariables = () => ({})) {
2121
const additionalProps = { forceUpdate: this.forceUpdateHelper };
2222
const asyncBody = asyncFn(Object.assign(additionalProps, variables, props));
2323

24+
this.setState(() => ({ body: React.createElement('noscript'), variables }));
25+
2426
if (asyncBody instanceof Promise) {
2527
asyncBody.then(body => {
2628
this.setState(() => ({ body, variables }));

0 commit comments

Comments
 (0)