Describe the bug
When initialData is specified with a function, it prevents cached data from being reused (repro below).
Your minimal, reproducible example
https://stackblitz.com/edit/vitejs-vite-rayu8t?file=src%2FApp.tsx,src%2FTodos.tsx,package.json
Steps to reproduce
Refresh the repo.
Quickly select "High" from the dropdown.
The results will change.
Quickly re-select "All."
The cached "All" results will not re-show.
Expected behavior
The cached data should be re-used within the staleTime window.
How often does this bug happen?
Every time
Screenshots or Videos
n/a
Platform
MacOS / Chrome
react-query version
4.13.5
TypeScript version
n/a
Additional context
n/a