Skip to content

Commit 23f8d1e

Browse files
committed
Use catch instead of then(..., onReject).
1 parent 3508370 commit 23f8d1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-async/src/specs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export const withPromise = Async => () => {
175175
const { findByText } = render(
176176
<Async promise={resolveTo("done")}>
177177
{({ data, promise }) => {
178-
promise.then(onFulfilled, onRejected)
178+
promise.then(onFulfilled).catch(onRejected)
179179
return data || null
180180
}}
181181
</Async>
@@ -191,7 +191,7 @@ export const withPromise = Async => () => {
191191
const { findByText } = render(
192192
<Async promise={rejectTo("err")}>
193193
{({ error, promise }) => {
194-
promise.then(onFulfilled, onRejected)
194+
promise.then(onFulfilled).catch(onRejected)
195195
return error ? error.message : null
196196
}}
197197
</Async>

0 commit comments

Comments
 (0)