mirror of
https://github.com/streamich/react-use.git
synced 2026-01-25 14:17:16 +00:00
fix: reset state when calling useEffect in useAsync
This commit is contained in:
parent
752e92a0f2
commit
2f5af2ca66
@ -25,6 +25,9 @@ const useAsync = <T>(fn: () => Promise<T>, args?) => {
|
||||
|
||||
useEffect(() => {
|
||||
let mounted = true;
|
||||
set({
|
||||
loading: true,
|
||||
});
|
||||
const promise = memoized();
|
||||
|
||||
promise
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user