Skip to content
Back to skills

Client Swr Dedup

ASecurity

Imported skill client_swr_dedup from vercel

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 11, 2026
developmentreactapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 11, 2026

npx -y skills add bitwikiorg/skills.md --skill client_swr_dedup --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Client Swr Dedup?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Client Swr Dedup
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bitwikiorg-client-swr-dedup/badge)](https://www.skillsdirectory.com/skills/bitwikiorg-client-swr-dedup)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Imported skill client_swr_dedup from vercel
name: client_swr_dedup
signature: 644652c39c6cc00de8d1c77a7273612e868dc3f7edda30764164c12ec0f764a3
source: /a0/tmp/skills_research/vercel/skills/react-best-practices/rules/client-swr-dedup.md
---

---
title: Use SWR for Automatic Deduplication
impact: MEDIUM-HIGH
impactDescription: automatic deduplication
tags: client, swr, deduplication, data-fetching
---

## Use SWR for Automatic Deduplication

SWR enables request deduplication, caching, and revalidation across component instances.

**Incorrect (no deduplication, each instance fetches):**

```tsx
function UserList() {
  const [users, setUsers] = useState([])
  useEffect(() => {
    fetch('/api/users')
      .then(r => r.json())
      .then(setUsers)
  }, [])
}
```

**Correct (multiple instances share one request):**

```tsx
import useSWR from 'swr'

function UserList() {
  const { data: users } = useSWR('/api/users', fetcher)
}
```

**For immutable data:**

```tsx
import { useImmutableSWR } from '@/lib/swr'

function StaticContent() {
  const { data } = useImmutableSWR('/api/config', fetcher)
}
```

**For mutations:**

```tsx
import { useSWRMutation } from 'swr/mutation'

function UpdateButton() {
  const { trigger } = useSWRMutation('/api/user', updateUser)
  return <button onClick={() => trigger()}>Update</button>
}
```

Reference: [https://swr.vercel.app](https://swr.vercel.app)

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…