- Add 8 new skills (62 total, up from 58) - Official Anthropic skills: docx, pdf, pptx, xlsx, brand-guidelines, internal-comms - Vercel Labs skills: react-best-practices, web-design-guidelines - Implement dual-versioning: -official/-anthropic and -community suffixes - Update README with new skill registry and credits - Regenerate skills_index.json (62 skills validated) - Add comprehensive walkthrough.md BREAKING CHANGE: Document skills (docx/pdf/pptx/xlsx) renamed with version suffixes
724 B
724 B
title, impact, impactDescription, tags
| title | impact | impactDescription | tags |
|---|---|---|---|
| Subscribe to Derived State | MEDIUM | reduces re-render frequency | 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):
function Sidebar() {
const width = useWindowWidth() // updates continuously
const isMobile = width < 768
return <nav className={isMobile ? 'mobile' : 'desktop'}>
}
Correct (re-renders only when boolean changes):
function Sidebar() {
const isMobile = useMediaQuery('(max-width: 767px)')
return <nav className={isMobile ? 'mobile' : 'desktop'}>
}