refetch data after 10 seconds
Hi! I'm using useQuery like this
However, the Scoreboard data isn't updated each refetch call
5 Replies
flat-fuchsia•4y ago
Hi. Set
refetchInterval (ms) in useQuery options.absent-sapphireOP•4y ago
I've done that but even though the api is constanly sent, the "data" does not change
flat-fuchsia•4y ago
Please provide minimal reproduction code or query snippet
absent-sapphireOP•4y ago
The item will go down all the other children components
flat-fuchsia•4y ago
Maybe you api doesn't update data each 10 sec 🙂
Also be sure
TIME_REFETCH is integer in ms. Try to check network activity in devtools Network tab
Here is minimal code with refetchInteval
https://codesandbox.io/s/happy-river-gfnhqx?file=/src/App.jsmaxshy
CodeSandbox
happy-river-gfnhqx - CodeSandbox
happy-river-gfnhqx by maxshy using @tanstack/react-query, react, react-dom, react-scripts