refactor: Don't return full tanstack query result#1827
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
WalkthroughEight React Query hooks across health checks, data retrieval, and provider-specific models are refactored to return ChangesQuery hooks direct return refactoring
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
When you write
const queryResult = useQuery(...), TanStack Query hands you the full result object — but it has no way to know which fields you actually use. So it conservatively re-renders your component whenever any field changes (fetchStatus,dataUpdatedAt, internal counters, etc.), even if you only care aboutdataandisLoading.Summary by CodeRabbit