factory-ai avatar

No Use Effect

This skill enforces a strict no useEffect rule in React codebases by providing five concrete replacement patterns: derive state inline instead of syncing it, use data-fetching libraries like useQuery, handle user actions in event handlers, use the escape hatch useMountEffect for legitimate mount-only side effects, and leverage the key prop to reset component state. It activates during component writing, refactoring, and PR reviews to catch unnecessary effects before they ship. The approach comes from production experience with race conditions and extra render cycles. If you've inherited a codebase full of setState inside useEffect or fetch wrapped in dependency arrays, this gives you a systematic way to clean it up. Includes ESLint config and verification commands.

skills.sh installs
1.1K
GitHub stars
124
last updated
Aug 21, 2026

Install

$ npx -y skills add factory-ai/factory-plugins --skill no-use-effect --agent claude-code

Installs into .claude/skills of the current project.

Files

No useEffect

Never call useEffect directly. Use derived state, event handlers, data-fetching libraries, or useMountEffect instead.

Quick Reference

Instead of useEffect for...Use
Deriving state from other state/propsInline computation (Rule 1)
Fetching datauseQuery / data-fetching library (Rule 2)
Responding to user actionsEvent handlers (Rule 3)
One-time external sync on mountuseMountEffect (Rule 4)
Resetting state when a prop changeskey prop on parent (Rule 5)

When to Use This Skill

  • Writing new React components
  • Refactoring existing useEffect calls
  • Reviewing PRs that introduce useEffect
  • An agent adds useEffect "just in case"

Workflow

1. Identify the useEffect

Determine what the effect is doing -- deriving state, fetching data, responding to an event, syncing with an external system, or resetting state.

Sponsors

Details

Repository
github.com/factory-ai/factory-plugins
Categories
Frontend Development, Documentation, Code Review & Quality, AI & Agent Building
First seen
Jun 3, 2026

More from factory-ai/factory-plugins

All 3
1bobmatnyc avatartrpc-type-safetybobmatnyc/claude-mpm-skillstRPC end-to-end type-safe APIs for TypeScript with React Query integration and full-stack type safety1Kskills.sh installs
2dalestudy avatarstorybookdalestudy/skillsStorybook 스토리 작성 및 CSF 3.0 베스트 프랙티스 스킬. 다음 상황에서 사용: (1) 새 스토리 파일(.stories.tsx, .stories.ts) 작성 시, (2) 기존 스토리 수정 시, (3) Args, Decorators, Parameters 설정 시, (4) St980skills.sh installs
3chrisbanes avatarcompose-slot-api-patternchrisbanes/skillsUse when designing or reviewing a reusable Jetpack Compose component whose visual regions vary by caller, or when primitive content parameters and boolean shape970skills.sh installs
4patternsdev avatarstatic-renderingpatternsdev/skillsTeaches static rendering (SSG) for build-time HTML generation. Use when your pages don't change per request and can be pre-rendered at build time for maximum ca965skills.sh installs
5mindrally avatardesign-systemsmindrally/skillsComprehensive design system guidelines for building consistent, accessible, and scalable component libraries. Use when creating design tokens, building componen932skills.sh installs
6heygen-com avatarvisual-styleheygen-com/skillsCreate, extract, and apply portable visual design systems via visual-style.md files. Use when: (1) Creating a visual-style.md design system from scratch, (2) Ex921skills.sh installs