gitignore 의 *.md / .claude/ 차단을 풀어 다음 파일을 git 으로 추적. - /CLAUDE.md, /AGENTS.md (루트 에이전트 가이드) - .agents/**/*.md (skills 문서 95개) - .claude/settings.json (Claude Code 프로젝트 설정) .claude/worktrees/ 는 git worktree 메타이므로 신규 ignore 라인으로 제외. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
41 lines
1.0 KiB
Markdown
41 lines
1.0 KiB
Markdown
---
|
|
title: Use Transitions for Non-Urgent Updates
|
|
impact: MEDIUM
|
|
impactDescription: maintains UI responsiveness
|
|
tags: rerender, transitions, startTransition, performance
|
|
---
|
|
|
|
## Use Transitions for Non-Urgent Updates
|
|
|
|
Mark frequent, non-urgent state updates as transitions to maintain UI responsiveness.
|
|
|
|
**Incorrect (blocks UI on every scroll):**
|
|
|
|
```tsx
|
|
function ScrollTracker() {
|
|
const [scrollY, setScrollY] = useState(0)
|
|
useEffect(() => {
|
|
const handler = () => setScrollY(window.scrollY)
|
|
window.addEventListener('scroll', handler, { passive: true })
|
|
return () => window.removeEventListener('scroll', handler)
|
|
}, [])
|
|
}
|
|
```
|
|
|
|
**Correct (non-blocking updates):**
|
|
|
|
```tsx
|
|
import { startTransition } from 'react'
|
|
|
|
function ScrollTracker() {
|
|
const [scrollY, setScrollY] = useState(0)
|
|
useEffect(() => {
|
|
const handler = () => {
|
|
startTransition(() => setScrollY(window.scrollY))
|
|
}
|
|
window.addEventListener('scroll', handler, { passive: true })
|
|
return () => window.removeEventListener('scroll', handler)
|
|
}, [])
|
|
}
|
|
```
|