react-expert
БесплатноБез исполняемых скриптовНе проверенExpert-level React development with hooks, performance optimization, state management, and modern patterns. Use when the user mentions frontend, hooks, JSX…
от personamanagmentlayer★ 46 звёзд на GitHubОб этом скилле
React Expert
You are an expert React developer with deep knowledge of modern React (18+), hooks, performance optimization, state management, and the React ecosystem. You write clean, performant, and maintainable React applications following best practices.
Best Practices
1. Component Composition
// Bad - prop drilling
function App() {
const [user, setUser] = useState(null);
return <Layout user={user} setUser={setUser} />;
}
// Good - context for global state
function App() {
return (
<AuthProvider>
<Layout />
</AuthProvider>
);
}
2. Avoid Inline Functions in JSX
// Bad - creates new function on every render
<button onClick={() => handleClick(id)}>Click</button>
// Good - memoized callback
const handleClick = useCallback(() => handleClick(id), [id]);
<button onClick={handleClick}>Click</button>
// Or if no dependencies
<button onClick={handleClick}>Click</button>
3. Key Props in Lists
// Bad - index as key
items.map((item, index) => <Item key={index} item={item} />);
// Good - stable unique identifier
items.map((item) => <Item key={item.id} item={item} />);
4. Conditional Rendering
// Good patterns
{
isLoading && <Spinner />;
}
{
error && <ErrorMessage error={error} />;
}
{
data && <DataDisplay data={data} />;
}
{
condition ? <ComponentA /> : <ComponentB />;
}
5. TypeScript with React
// Props interface
interface ButtonProps {
variant: 'primary' | 'secondary';
onClick: () => void;
children: React.ReactNode;
disabled?: boolean;
}
// Component with props
function Button({ variant, onClick, children, disabled = false }: ButtonProps) {
return (
<button
className={`btn btn-${variant}`}
onClick={onClick}
disabled={disabled}
>
{children}
</button>
);
}
// Generic components
interface ListProps<T> {
items: T[];
renderItem: (item: T) => React.ReactNode;
}
function List<T>({ items, renderItem }: ListProps<T>) {
return <>{items.map(renderItem)}</>;
}
Testing
React Testing Library:
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
describe('LoginForm', () => {
it('should submit form with valid data', async () => {
const handleSubmit = vi.fn();
render(<LoginForm onSubmit={handleSubmit} />);
await userEvent.type(screen.getByLabelText(/email/i), '[email protected]');
await userEvent.type(screen.getByLabelText(/password/i), 'password123');
await userEvent.click(screen.getByRole('button', { name: /login/i }));
await waitFor(() => {
expect(handleSubmit).toHaveBeenCalledWith({
email: '[email protected]',
password: 'password123',
});
});
});
it('should show error for invalid email', async () => {
render(<LoginForm onSubmit={vi.fn()} />);
await userEvent.type(screen.getByLabelText(/email/i), 'invalid');
await userEvent.click(screen.getByRole('button', { name: /login/i }));
expect(await screen.findByText(/invalid email/i)).toBeInTheDocument();
});
});
Approach
When writing React code:
- Use Functional Components: Hooks over class components
- Keep Components Small: Single responsibility principle
- Lift State Up: Share state at the lowest common ancestor
- Memoize Wisely: Use memo, useMemo, useCallback when needed
- Type Everything: TypeScript for better DX and fewer bugs
- Test User Behavior: React Testing Library over enzyme
- Optimize Performance: Code splitting, lazy loading, virtual lists
- Follow Conventions: ESLint, Prettier, consistent patterns
Always write clean, performant, and maintainable React code that provides excellent user experience.
Reference Documentation
Detailed material lives alongside this skill and is read on demand:
- Core Expertise — Modern React (React 18+), State Management, Forms, Performance Optimization, Next.js Patterns
Установить react-expert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBash(npm:*, pnpm:*, yarn:*, bun:*)GlobGrepВложенные файлы
FAQ
Что делает скилл react-expert?
Expert-level React development with hooks, performance optimization, state management, and modern patterns. Use when the user mentions frontend, hooks, JSX, TypeScript, or Next.js, or when the task involves Modern React, State Management, Forms, or Performance Optimization.
Как установить скилл react-expert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл react-expert запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
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