Skip to content

Commit 17e2d54

Browse files
committed
Pass options into promiseFn instead of lastOptions
1 parent f6f2dbd commit 17e2d54

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-async/src/useAsync.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,11 @@ const useAsync = (arg1, arg2) => {
9797
.then(handleResolve(counter.current))
9898
.catch(handleReject(counter.current))
9999
} else if (promiseFn && !isPreInitialized) {
100-
start(() => promiseFn(lastOptions.current, abortController.current))
100+
start(() => promiseFn(options, abortController.current))
101101
.then(handleResolve(counter.current))
102102
.catch(handleReject(counter.current))
103103
}
104-
}, [start, promise, promiseFn, initialValue, handleResolve, handleReject])
104+
}, [initialValue, promise, promiseFn, start, handleResolve, handleReject, options])
105105

106106
const { deferFn } = options
107107
const run = useCallback(

0 commit comments

Comments
 (0)