Skip to content

Commit 5ff3c11

Browse files
fix compatibility issue with polyfilled Promises
1 parent 0263ef1 commit 5ff3c11

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
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 v1.0.2
2+
3+
* Fix compatibility issue with polyfilled Promises
4+
15
## react-coroutine v1.0.1
26

37
* Fix the usage of `contextTypes` for async functions

modules/CoroutineRender.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default class AsyncComponent extends Component {
1818

1919
this.iterator = asyncBody;
2020

21-
if (asyncBody instanceof Promise) {
21+
if (typeof asyncBody.then === 'function') {
2222
asyncBody.then(body => {
2323
if (this.isComponentMounted && this.iterator === asyncBody) {
2424
this.setState(() => ({ body, variables }));

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-coroutine",
3-
"version": "1.0.1",
3+
"version": "1.0.2",
44
"description": "React Components as Coroutines",
55
"main": "lib/Coroutine.js",
66
"module": "modules/Coroutine.js",

0 commit comments

Comments
 (0)