What problem does it solve? Managing server state in React apps—fetching, caching, revalidating, and mutating remote data—requires repetitive boilerplate and careful handling of loading, error, and stale-data states. This Skill provides expert guidance on the SWR library so you can implement the stale-while-revalidate pattern correctly from the start. ## Core Features & Use Cases - Data Fetching with useSWR: Fetch and cache remote data with automatic deduplication, revalidation on focus/reconnect, and error retry with exponential backoff. - Mutations & Optimistic UI: Use useSWRMutation with optimisticData, rollbackOnError, and populateCache for responsive update flows. - Pagination & Real-Time: Handle infinite loading with useSWRInfinite and live data streams with useSWRSubscription for WebSockets or SSE. - Use Case: You are building a dashboard that polls an API every few seconds, shows optimistic updates when users edit records, and paginates a long list—configure SWRConfig once and let the hooks handle caching and revalidation. ## Quick Start Ask the AI to build a React component that fetches user data from an API endpoint using SWR with loading and error states.