React logo

React

Community
nimadorostkar
react

Use when writing or reviewing React. Covers component and state design, hook correctness, memoization that is actually needed, data fetching, and the render behavior behind most React performance problems. Trigger on "component re-renders too much", "state is stale in my useeffect", "do i need usememo here", "where should this state live". Do not use for server components and App Router caching — see the nextjs skill; for mobile, see the react-native skill.

Overview

Publishernimadorostkar
RepositoryClaude-Skills-collection
Skill namereact
Stars
34
Forks
4
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by nimadorostkar on GitHub. Read the source before you install it.

Installation

Install the React AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/frontend/react
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection.git /tmp/Claude-Skills-collection
mkdir -p .claude/skills
cp -r /tmp/Claude-Skills-collection/skills/frontend/react .claude/skills/react
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable React in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads React on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so React is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

React

Purpose

Write React where state lives in one place, effects are rare, and re-renders are understood rather than suppressed with memoization applied at random.

When to Use

  • Building or reviewing React components.
  • Diagnosing unnecessary re-renders or stale state.
  • Deciding where state belongs: local, lifted, context, or server.
  • Removing useEffect calls that should not exist.

Capabilities

  • Component decomposition and state colocation.
  • Hook correctness: dependencies, cleanup, and the rules that are not optional.
  • State management selection: useState, useReducer, context, external store, server state.
  • Data fetching with TanStack Query or the framework's own loader.
  • Render profiling and targeted memoization.

Inputs

  • The component tree and where data enters it.
  • The interaction and its performance characteristics, if performance is the concern.
  • React version — the correct answer changed with 18 and again with 19.

Outputs

  • Components with a single source of truth for each piece of state.
  • Effects only where genuinely synchronizing with an external system.
  • Memoization applied where a profile shows it is needed.

Workflow

  1. Locate the state — Put it as close to where it is used as possible. Lift only when two siblings need it. Reach for context only when prop drilling exceeds about three levels.
  2. Separate server state from client state — Data from an API is cache, not state. It has staleness, refetching, and error semantics that useState does not model. Use a query library.
  3. Delete unnecessary effects — An effect that computes a value from props belongs in render. An effect that resets state on a prop change belongs in a key. Most useEffect calls in a typical codebase should not exist.
  4. Profile before memoizing — React DevTools Profiler shows what actually re-renders and why. useMemo on a cheap computation costs more than it saves.
  5. Make the dependencies honest — Never silence the exhaustive-deps lint rule. If the array is wrong, the bug is a stale closure, and it will be intermittent.

Best Practices

  • Derived state is a bug. If a value can be computed from props or other state, compute it during render.
  • useEffect is for synchronizing with something outside React: a subscription, a DOM API, a timer. It is not for reacting to state changes.
  • Every effect that subscribes must return a cleanup function. Missing cleanup is the standard cause of memory leaks and duplicate listeners.
  • Do not put a non-stable key on a list. Index keys break every time the list is reordered or filtered.
  • Context re-renders every consumer when its value changes. Split contexts by update frequency, or use an external store with selectors.
  • Lift state up only as far as needed. State in the root component re-renders the tree.

Examples

An effect that should not exist:

jsx
// Wrong: derived state, an extra render, and a chance to be out of sync.
function Cart({ items }) {
  const [total, setTotal] = useState(0);
  useEffect(() => {
    setTotal(items.reduce((sum, i) => sum + i.price * i.qty, 0));
  }, [items]);
  return <Total value={total} />;
}

// Right: compute it during render. It is always correct, by construction.
function Cart({ items }) {
  const total = items.reduce((sum, i) => sum + i.price * i.qty, 0);
  return <Total value={total} />;
}

Server state belongs in a query, not in useState plus useEffect:

jsx
function OrderList({ status }) {
  const { data, isPending, error } = useQuery({
    queryKey: ["orders", status],
    queryFn: ({ signal }) => fetchOrders(status, { signal }),
    staleTime: 30_000,
  });

  if (isPending) return <Skeleton />;
  if (error) return <ErrorState error={error} onRetry={() => refetch()} />;
  return <List items={data} />;
}

The manual version needs loading state, error state, cancellation on unmount, a race-condition guard when status changes mid-flight, and a cache. That is what the library is.

Notes

  • The React Compiler (React 19) auto-memoizes and removes most hand-written useMemo and useCallback. Do not spend effort on memoization you are about to delete.
  • Strict Mode in development intentionally double-invokes effects to surface missing cleanup. An effect that breaks under Strict Mode is broken in production too — it just fails less often.
  • key on a component is the idiomatic way to reset its state when an identity changes. It is far cleaner than an effect that resets fields.

Frequently asked questions

What does the React AI skill do?

Use when writing or reviewing React. Covers component and state design, hook correctness, memoization that is actually needed, data fetching, and the render behavior behind most React performance problems. Trigger on "component re-renders too much", "state is stale in my useeffect", "do i need usememo here", "where should this state live". Do not use for server components and App Router caching — see the nextjs skill; for mobile, see the react-native skill.

Why use React on TypingMind?

Because you install it once and use it with any model. React is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install React in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/frontend/react. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use React?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with React?

As many as you like. As long as a model supports skills, you can use React with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the React AI skill free?

Yes. It is published on GitHub by nimadorostkar under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇