react-expert
БесплатноЗапускает вложенные скриптыНе проверенReact ecosystem expert including hooks, state management, component patterns, React 19 features, Shadcn UI, and Radix primitives
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
React Expert
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/useCallbackwhere the compiler can infer them - Only add
React.memo,useMemo,useCallbackwhen 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.lazyandSuspense - 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,useCallbackwrappers — the compiler handles them - Compiler opt-out: add
// @no-react-compilerpragma to a component/file when manual control is needed - Still use
useMemo/useCallbackfor: stable refs passed to third-party libs, expensive computations with external deps the compiler cannot see
Actions
- Use async functions as form
actionprops 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
useActionStateto track the result and pending state of a form Action - Signature:
const [state, formAction, isPending] = useActionState(fn, initialState) isPendingreplaces the manualuseState(false)loading flag patternstateholds 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
useOptimisticfor 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
Установить react-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGrepGlobВложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic