Skip to content

Commit b0b5342

Browse files
committed
Fix #20: TypeError caused by calling abort() with invalid context.
1 parent 540d8c3 commit b0b5342

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useAsync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const useAsync = (opts, init) => {
8585
})
8686
useEffect(() => (promiseFn ? load() && undefined : cancel()), [promiseFn, watch])
8787
useEffect(() => () => (isMounted.current = false), [])
88-
useEffect(() => abortController.current.abort, [])
88+
useEffect(() => () => abortController.current.abort(), [])
8989
useEffect(() => (prevOptions.current = options) && undefined)
9090

9191
return useMemo(

0 commit comments

Comments
 (0)