Skip to content
Back to skills

Rerender Defer Reads

ASecurity

Imported skill rerender_defer_reads from vercel

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

Works with

  • cli

Security analysis

A100/100

Scanned September 11, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Rerender Defer Reads?

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

Security grade badge for Rerender Defer Reads
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bitwikiorg-rerender-defer-reads/badge)](https://www.skillsdirectory.com/skills/bitwikiorg-rerender-defer-reads)

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 rerender_defer_reads from vercel
name: rerender_defer_reads
signature: 234050a77faf50cb306be10a9e15bd4421134ab5907e75f13e6d78e2bd262dc9
source: /a0/tmp/skills_research/vercel/skills/react-best-practices/rules/rerender-defer-reads.md
---

---
title: Defer State Reads to Usage Point
impact: MEDIUM
impactDescription: avoids unnecessary subscriptions
tags: rerender, searchParams, localStorage, optimization
---

## Defer State Reads to Usage Point

Don't subscribe to dynamic state (searchParams, localStorage) if you only read it inside callbacks.

**Incorrect (subscribes to all searchParams changes):**

```tsx
function ShareButton({ chatId }: { chatId: string }) {
  const searchParams = useSearchParams()

  const handleShare = () => {
    const ref = searchParams.get('ref')
    shareChat(chatId, { ref })
  }

  return <button onClick={handleShare}>Share</button>
}
```

**Correct (reads on demand, no subscription):**

```tsx
function ShareButton({ chatId }: { chatId: string }) {
  const handleShare = () => {
    const params = new URLSearchParams(window.location.search)
    const ref = params.get('ref')
    shareChat(chatId, { ref })
  }

  return <button onClick={handleShare}>Share</button>
}
```

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.