Communitygithub.com

ComeOnOliver/skillshub

React useEffect 모범 사례를 공식 문서 기준으로 제시합니다. useEffect, useState를 사용한 파생 값 계산, 데이터 페칭, 상태 동기화를 작성하거나 검토할 때 유용합니다. Effect가 필요하지 않은 경우와 더 나은 대안을 알려줍니다.

skillshub란 무엇인가요?

이 스킬은 React 개발자가 `useEffect`를 올바르게 사용하도록 돕는 지침을 제공합니다. React 공식 문서의 'You Might Not Need an Effect' 원칙을 기반으로, Effect가 정말 필요한 외부 시스템 동기화, 구독, 분석 로깅, 데이터 페칭(적절한 정리 포함) 같은 상황과 그렇지 않은 상황(파생 상태 계산, 사용자 이벤트 처리, 상태 체인 업데이트)을 명확히 구분합니다. 특히, `useMemo`, `key` prop, 이벤트 핸들러, `useSyncExternalStore` 등 Effect 없이도 동일한 목적을 달성할 수 있는 더 나은 React 패턴을 제시합니다. CLI 기반의 AI 에이전트(Claude Code, Cursor, Codex 등)에서 사용할 수 있으며, 의사 결정 트리와 빠른 참조 테이블을 포함하여 복잡한 React 상태 관리 결정을 간결하게 안내합니다. 이 스킬을 통해 개발자는 불필요한 Effect를 줄이고, 성능과 유지보수성이 뛰어난 React 컴포넌트를 작성할 수 있습니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/jarrodwatts/claude-code-config/react-useeffect

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Effect가 필요하지 않을 수 있습니다

Effect는 React의 탈출구입니다. 외부 시스템과 동기화할 때 사용합니다. 외부 시스템이 관련되지 않았다면 Effect가 필요하지 않습니다.

빠른 참조

상황사용하지 말아야 할 방법올바른 방법
props/state로부터 파생된 상태useState + useEffect렌더링 중에 계산
비용이 큰 계산caching을 위한 useEffectuseMemo
prop 변경 시 상태 재설정useEffect + setStatekey prop
사용자 이벤트 응답상태를 감시하는 useEffect직접 이벤트 핸들러
부모에게 변경 알림onChange를 호출하는 useEffect이벤트 핸들러에서 호출
데이터 가져오기정리(cleanup) 없는 useEffect정리가 있는 useEffect 또는 프레임워크

Effect가 필요한 경우

  • 외부 시스템(비-React 위젯, 브라우저 API)과 동기화
  • 외부 저장소 구독(가능하면 useSyncExternalStore 사용)
  • 컴포넌트가 표시되어 실행되는 분석/로깅
  • 적절한 정리(cleanup)를 동반한 데이터 페칭(또는 프레임워크의 내장 메커니즘 사용)

Effect가 필요하지 않은 경우

  1. 렌더링을 위한 데이터 변환 - 최상위 레벨에서 계산, 자동으로 재실행됨
  2. 사용자 이벤트 처리 - 이벤트 핸들러 사용, 정확히 무엇이 발생했는지 알 수 있음
  3. 상태 파생 - 그냥 계산: const fullName = firstName + ' ' + lastName
  4. 상태 업데이트 연결 - 이벤트 핸들러 안에서 모든 다음 상태를 한 번에 계산

의사 결정 트리

무언가에 응답해야 하는가?
├── 사용자 상호작용(클릭, 제출, 드래그)?
│   └── 이벤트 핸들러 사용
├── 컴포넌트가 화면에 나타남?
│   └── Effect 사용(외부 동기화, 분석)
├── props/state가 변경되어 파생 값이 필요?
│   └── 렌더링 중에 계산
│       └── 비용이 큰가? useMemo 사용
└── prop 변경 시 상태를 재설정해야 함?
    └── 컴포넌트에 key prop 사용

상세 안내

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

관련 스킬