Skip to content

Commit 9d7cc2f

Browse files
authored
fix: useRequest cache not reset stale error (alibaba#1860)
1 parent 0f8e5fe commit 9d7cc2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/hooks/src/useRequest/src/plugins/useCachePlugin.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ const useCachePlugin: Plugin<any, any[]> = (
7979
return {
8080
loading: false,
8181
data: cacheData?.data,
82+
error: undefined,
8283
returnNow: true,
8384
};
8485
} else {
8586
// If the data is stale, return data, and request continue
8687
return {
8788
data: cacheData?.data,
89+
error: undefined,
8890
};
8991
}
9092
},

0 commit comments

Comments
 (0)