Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

react-expert

БесплатноЗапускает вложенные скриптыНе проверен

React ecosystem expert including hooks, state management, component patterns, React 19 features, Shadcn UI, and Radix primitives

oimiragieoот oimiragieo★ 48 звёзд на GitHub

Об этом скилле

React Expert

React ecosystem expert with deep knowledge of hooks, state management, component patterns, React 19 features, Shadcn UI, and Radix primitives. - Review code for React best practices - Implement modern React patterns (React 19) - Design component architectures - Optimize React performance - Build accessible UI with Radix/Shadcn

Component Structure

  • Use functional components over class components
  • Keep components small and focused
  • Extract reusable logic into custom hooks
  • Use composition over inheritance
  • Implement proper prop types with TypeScript
  • Split large components into smaller, focused ones

Hooks

  • Follow the Rules of Hooks
  • Use custom hooks for reusable logic
  • Keep hooks focused and simple
  • Use appropriate dependency arrays in useEffect
  • Implement cleanup in useEffect when needed
  • Avoid nested hooks

State Management

  • Use useState for local component state
  • Implement useReducer for complex state logic
  • Use Context API for shared state
  • Keep state as close to where it's used as possible
  • Avoid prop drilling through proper state management
  • Use state management libraries only when necessary

Performance

  • Use React Compiler (available in React 19) for automatic memoization — remove manual useMemo/useCallback where the compiler can infer them
  • Only add React.memo, useMemo, useCallback when the compiler cannot help (complex object identity, external deps, stable callback refs for third-party libraries)
  • Avoid unnecessary re-renders; verify with React DevTools Profiler before adding manual memoization
  • Implement proper lazy loading with React.lazy and Suspense
  • Use proper key props in lists
  • Keep components small and focused — small components maximize compiler optimization surface

React 19 Features

React Compiler

  • The React Compiler (stable in React 19) performs automatic memoization at build time
  • Remove redundant React.memo, useMemo, useCallback wrappers — the compiler handles them
  • Compiler opt-out: add // @no-react-compiler pragma to a component/file when manual control is needed
  • Still use useMemo/useCallback for: stable refs passed to third-party libs, expensive computations with external deps the compiler cannot see

Actions

  • Use async functions as form action props for automatic pending/error state management
  • Actions replace the onSubmit + manual loading/error state boilerplate pattern
  • Server Actions (in Next.js / RSC frameworks) allow calling server-side code directly from forms
// Form Action pattern (React 19)
async function saveUser(formData: FormData) {
  'use server'; // only in RSC frameworks; omit for client Actions
  await db.users.update({ name: formData.get('name') });
}
<form action={saveUser}>
  <input name="name" />
  <button type="submit">Save</button>
</form>;

useActionState

  • Use useActionState to track the result and pending state of a form Action
  • Signature: const [state, formAction, isPending] = useActionState(fn, initialState)
  • isPending replaces the manual useState(false) loading flag pattern
  • state holds the return value of the last action invocation (success data or error)
import { useActionState } from 'react';

async function submitAction(prevState: State, formData: FormData) {
  const result = await saveData(formData);
  return result.error ? { error: result.error } : { success: true };
}

function MyForm() {
  const [state, formAction, isPending] = useActionState(submitAction, null);
  return (
    <form action={formAction}>
      {state?.error && <p>{state.error}</p>}
      <button disabled={isPending}>{isPending ? 'Saving...' : 'Save'}</button>
    </form>
  );
}

useOptimistic

  • Use useOptimistic for instant UI feedback before a server response arrives
  • Signature: const [optimisticState, setOptimistic] = useOptimistic(value, reducer?)
  • The optimistic value automatically reverts to the real value when the Action resolves
  • Always pair with Actions (the optimistic state is scoped to the Action's lifetime)
import { useOptimistic } from 'react';

function ItemList({ items, addItem }: Props) {
  const [optimisticItems, addOptimistic] = useOptimistic(items, (state, newItem) => [
    ...state,
    { ...newItem, pending: true },
  ]);
  async function action(formData: FormData) {
    const newItem = { text: formData.get('text') as string, id: crypto.randomUUID() };
    addOptimistic(newItem);
    await addItem(newItem);
  }
  return (
    <ul>
      {optimisticItems.map(item => (
        <li key={item.id} className={item.pending ? 'opacity-50' : ''}>
          {item.text}
        </li>
      ))}
      <form action={action}>
        <input name="text" />
        <button>Add</button>
      </form>
    </ul>
  );
}

use() hook

  • use(promise) — read a Promise's resolved value during render (integrates with Suspense/ErrorBoundar
Полный SKILL.md на GitHub

Установить react-expert в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Read
Write
Edit
Bash
Grep
Glob

Вложенные файлы

commands/react-expert.mdhooks/post-execute.cjshooks/pre-execute.cjsreferences/research-requirements.mdrules/react-expert.mdschemas/input.schema.jsonschemas/output.schema.jsonscripts/main.cjstemplates/implementation-template.md

FAQ

Что делает скилл react-expert?

React ecosystem expert including hooks, state management, component patterns, React 19 features, Shadcn UI, and Radix primitives

Как установить скилл react-expert?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл react-expert запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить react-expert с