Joshkop
Joshkop5mo ago

Component suspends/rerenders on cached querykey

I've been trying to fix this issue for ours but dont get ahead I have a query which takes in a string literal value as an input This input is changed by the component prop (Which happens, when in the parent component the select input changes) When the prop first changes to a specifiy key everything works fine. The suspend fallback is shown until the data arrives Also on changing to a prop/key which wasnt cached/loaded yet But as soon as I go back to one which was already loaded the cached values are shown first, then the suspend boundary is triggered and then the same data which was in the cache is rendered again Google said alot about React Strict mode but neither disabling it or trying in prod helped Any tips on where to look for the issue ?
Solution:
Somehow setting the staleTime to non 0 works as a solution
Jump to solution
1 Reply
Solution
Joshkop
Joshkop5mo ago
Somehow setting the staleTime to non 0 works as a solution