Skip to main content
Head-to-Head NPM Comparison

@tanstack/react-queryvsswr

Detailed package comparison for bundle size, weekly downloads, supply chain security, and license obligations.

Weekly Downloads Leader
@tanstack/react-query40.1M/wk
Security Grade Leader
Equal Rating100/100
TypeScript Ready
Both Native
Specification
@tanstack/react-queryv5.104.5
swrv2.5.1
Weekly Downloads40.1MWinner11.4M
Unpacked Size1.71 MB312.8 KB
Security Grade
A+(100/100)
A+(100/100)
Lifecycle Scripts Clean (No scripts) Clean (No scripts)
TypeScript Support Built-in Types (.d.ts) Built-in Types (.d.ts)
License TypeMITPERMISSIVEMITPERMISSIVE
Direct Dependencies12
Active Maintainers33
Last ReleaseOct 19, 2026Aug 12, 2026
Install Commandnpm i @tanstack/react-querynpm i swr
Full Security ReportView @tanstack/react-query AuditView swr Audit
Free Castov VS Code Tool

Compare Dependencies Directly in VS Code

Audit supply chain risks, compare lightweight alternative packages, and catch malicious install scripts straight inside your package.json editor.

Download VS Code Extension

Frequently Asked Questions

Which package is more popular, @tanstack/react-query or swr?
@tanstack/react-query is currently more popular with higher weekly downloads (40.1M/week) compared to swr (11.4M/week).
Which has better supply chain security, @tanstack/react-query or swr?
@tanstack/react-query has a security score of 100/100 (Grade A+), while swr holds 100/100 (Grade A+). Both packages have equal security standings.
Do @tanstack/react-query and swr provide TypeScript definitions?
@tanstack/react-query includes built-in TypeScript types, while swr includes native TypeScript definitions.
What licenses do @tanstack/react-query and swr use?
@tanstack/react-query is published under the MIT license (PERMISSIVE), and swr is licensed under MIT (PERMISSIVE).