-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
Description
Describe the bug
const [count, setCount] = useState(0);
const result = useQueries(
[1, 2].map((item) => {
return {
queryKey: [item, count],
queryFn: queryFn,
keepPreviousData: true
};
})
);
The result[x].data should be "previousData" when queryKey change, but it is undefined.
To Reproduce
Steps to reproduce the behavior:
- Go to https://codesandbox.io/s/usequeries-with-keeppreviousdata-c9cim?file=/src/index.js:559-781
- Click '++count'
- See
result[x].data
Expected behavior
result[x].data should always be {} when query key changed
Desktop (please complete the following information):
- OS: Mac
- Browser: chrome
- Version: v90
actaruss, owlas, peterlenagh, radist2s, ManishT20 and 1 more
