Skip to content
Back to skills

308 Rerender Derived State 1c326bb6

ASecurity

Subscribe to derived boolean state instead of continuous values to reduce re-render frequency.

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
tools

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 308-rerender-derived-state_1c326bb6 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 308 Rerender Derived State 1c326bb6?

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

Security grade badge for 308 Rerender Derived State 1c326bb6
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-308-rerender-derived-state-1c326bb6/badge)](https://www.skillsdirectory.com/skills/tools-only-308-rerender-derived-state-1c326bb6)

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
---
title: Subscribe to Derived State
impact: MEDIUM
impactDescription: reduces re-render frequency
tags: rerender, derived-state, media-query, optimization
---

## Subscribe to Derived State

Subscribe to derived boolean state instead of continuous values to reduce re-render frequency.

**Incorrect (re-renders on every pixel change):**

```tsx
function Sidebar() {
  const width = useWindowWidth()  // updates continuously
  const isMobile = width < 768
  return <nav className={isMobile ? 'mobile' : 'desktop'} />
}
```

**Correct (re-renders only when boolean changes):**

```tsx
function Sidebar() {
  const isMobile = useMediaQuery('(max-width: 767px)')
  return <nav className={isMobile ? 'mobile' : 'desktop'} />
}
```

Files in this skill

  • README.md969 B
  • skill.md728 B

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…