react-anti-patterns

Detect 18 common React anti-patterns with code examples and a review checklist.

Updated Feb 28, 2026
One-click install
npx skills add https://github.com/b4r7x/agent-skills --skill react-anti-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-anti-patterns
Source: https://github.com/b4r7x/agent-skills/tree/main/react-anti-patterns
Command: npx skills add https://github.com/b4r7x/agent-skills --skill react-anti-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers identify and fix common anti-patterns in React code, particularly useful for reviewing AI-generated code or code from junior developers, leading to more robust and maintainable applications.

Core Features & Use Cases

  • Comprehensive Anti-pattern Detection: Covers 18 common React anti-patterns, categorized by detection difficulty (hard, medium, easy).
  • Code Examples: Provides clear "before" (❌) and "after" (✅) code snippets for each anti-pattern.
  • Use Case: When reviewing a new feature implemented by an AI assistant, use this skill to quickly scan the code for potential issues like stale closures, state mutation, or useEffect abuse before merging.

Quick Start

Use the react-anti-patterns skill to review the provided React code for common anti-patterns.

Frequently Asked Questions about react-anti-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check my React code for common anti-patterns?

To check React code for common anti-patterns, you can review it against a checklist of 18 known issues. This process detects stale closures, state mutations, and useEffect misuse by comparing against provided code examples.

What are the most common React anti-patterns that cause hard-to-find bugs?

Common React anti-patterns that cause hard-to-find bugs include stale closures, component-inside-component definitions, state mutation, boolean explosion, and useEffect misuse. These issues often lead to unexpected rendering and state behaviors.

How do I review AI-generated React code before merging?

Reviewing AI-generated React code involves scanning for structural issues like state mutations and useEffect abuse. Using a categorized anti-pattern reference with before and after code examples helps quickly identify and fix flawed logic before merging.

Can I get code examples for fixing React useEffect misuse and stale closures?

Yes, you can get code examples for fixing React useEffect misuse and stale closures. The reference provides clear before (incorrect) and after (correct) code snippets to demonstrate how to resolve these specific anti-patterns.

Does this React anti-patterns checklist cover state mutation and boolean explosion?

Yes, this React anti-patterns checklist covers state mutation and boolean explosion. It identifies and explains 18 common issues categorized by detection difficulty, providing targeted strategies to resolve these specific frontend problems.