Skip to content

Commit 451d457

Browse files
committed
Don't catch promises so enable suspense to work
1 parent 59c451b commit 451d457

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Diff for: src/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ function TestHook({ callback, hookProps, onError, children }) {
55
try {
66
children(callback(hookProps))
77
} catch (err) {
8-
onError(err)
8+
if (err.then) {
9+
throw err
10+
} else {
11+
onError(err)
12+
}
913
}
1014
return null
1115
}

0 commit comments

Comments
 (0)