Use SWR or React Query for client-side real-time data
For data that changes frequently (notifications, dashboards), use SWR or React Query instead of manual useEffect + fetch.
Why This Matters
Manual useEffect + useState + fetch patterns require re-implementing caching, revalidation, error handling, and loading states that SWR handles automatically.
Tags
nextjssupabasedata-fetching
Related Rules
Catch this automatically on every PR
BeforeMerge scans your pull requests against this rule and 3+ others. Get actionable feedback before code ships.