University Ranking Frontend Deep Dive (Part 2): State Management, React Query, and Theme Architecture
This is Part 2 of our University Ranking Frontend code deep dive. Make sure you’ve read https://xiaruize.org/post/university-ranking-frontend/ and https://xiaruize.org/post/university-ranking-frontend-part-1/ first. Overview In Part 2, we’ll explore: ThemeContext - Implementing theme switching with platform-specific persistence LanguageContext - Managing internationalization and language preferences RankingsProvider - Using React Query for background data synchronization React Query Hooks - Building reusable data fetching patterns Platform-Specific Optimizations - Handling iOS, Android, and Web differently ThemeContext: Theme Management The ThemeContext manages the entire app’s visual theme—light mode, dark mode, or automatic (following system preference). Here’s the complete implementation: ...