---
title: "React guide"
url: "https://sarthakmishra.com/skills/react-guide"
description: "Write and review React components with this agent skill. Clarify where state belongs, simplify Effects and prevent stale responses from overwriting edits."
image: "https://sarthakmishra.com/og-images/skills/react-guide.webp"
---

[View HTML](https://sarthakmishra.com/skills/react-guide) · [Site index](https://sarthakmishra.com/llms.txt)

# React guide

Put state, Effects, Actions and rendering in the right place.

```bash
pnpm dlx skills add SarthakMishra/skills --skill react-guide
```

Use `/react-guide` in Claude Code or `$react-guide` in Codex. [Read the skill](https://github.com/SarthakMishra/skills/blob/main/skills/engineering/react-guide/SKILL.md).

Use it while writing, reviewing or refactoring React, especially when it’s unclear which component should hold state, Effects are doing too much, or old responses overwrite newer input. Point it at the component and describe the interaction to preserve.

## Example prompts

```text
/react-guide Split this editor into smaller components without losing its draft on unrelated rerenders.
```

```text
$react-guide Prevent an old save response from replacing newer editor state. Check pending, failure and unmount behavior.
```

## How it works

The agent checks how components render and share data. It keeps rendering free of side effects and calculates values from existing data instead of storing them in state. User actions belong in event handlers or Actions; Effects synchronize with external systems. It also covers Context, refs, component composition and async data.

API choices follow your installed React and framework versions and React Compiler configuration. Reviews explain the problem; implementation requests fix it and check the affected behavior, including pending requests, failures, rollback or hydration where relevant.

## Works well with

- [TypeScript guide](https://sarthakmishra.com/skills/ts-guide) for props and APIs that preserve type inference.
- [Design system](https://sarthakmishra.com/skills/design-system) for its shared appearance and variants.
- [Code smell](https://sarthakmishra.com/skills/code-smell) for a broader cleanup.

## Structured data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebSite",
      "@id": "https://sarthakmishra.com/#website",
      "url": "https://sarthakmishra.com/",
      "name": "Sarthak Mishra",
      "publisher": {
        "@id": "https://sarthakmishra.com/#person"
      },
      "inLanguage": "en"
    },
    {
      "@type": "Person",
      "@id": "https://sarthakmishra.com/#person",
      "name": "Sarthak Mishra",
      "url": "https://sarthakmishra.com/about",
      "jobTitle": "Design Engineer",
      "image": "https://sarthakmishra.com/og-images/sarthak-mishra.webp",
      "sameAs": [
        "https://github.com/SarthakMishra",
        "https://www.linkedin.com/in/itssarthakmishra/",
        "https://x.com/MishraMishry"
      ]
    },
    {
      "@type": "WebPage",
      "@id": "https://sarthakmishra.com/skills/react-guide#webpage",
      "url": "https://sarthakmishra.com/skills/react-guide",
      "name": "React Components & State Agent Skill - Sarthak Mishra",
      "description": "Write and review React components with this agent skill. Clarify where state belongs, simplify Effects and prevent stale responses from overwriting edits.",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://sarthakmishra.com/#website"
      },
      "about": {
        "@id": "https://sarthakmishra.com/#person"
      }
    }
  ]
}
```
