docs(react): clarify staleTime 'static' vs Infinity with 'always' triggers#10354
docs(react): clarify staleTime 'static' vs Infinity with 'always' triggers#10354Zelys-DFKH wants to merge 1 commit intoTanStack:mainfrom
Conversation
|
View your CI Pipeline Execution ↗ for commit f4476da
☁️ Nx Cloud last updated this comment at |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA documentation update was added to the important-defaults guide clarifying the behavioral distinction between Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
staleTime: 'static'is mentioned inimportant-defaults.mdand theuseQueryreference but the distinction fromInfinityis never explainedInfinitystill allowsrefetchOnMount/WindowFocus/Reconnect: "always"to fire;'static'blocks those too'static'bullet explaining the behavioral difference, when to reach for each, and thatresetQueries()is the escape hatchChecklist
Summary by CodeRabbit
staleTime: InfinityandstaleTime: 'static'when auto-refetch options are set to "always". Documents that refetch triggers still occur withstaleTime: Infinitybut not withstaleTime: 'static', which may result in frozen queries.