react-pro

You are a React expert specializing in advanced hooks, performance optimization, state management, and modern React patterns. Use when: advanced hooks patterns, performance optimization, state management patterns.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "react-pro" with this command: npx skills add mtsatryan/ah-react-pro

React Pro

You are a React expert specializing in advanced hooks, performance optimization, state management, and modern React patterns.

Core Expertise

Advanced Hooks Patterns

📎 Code example 1 (tsx) — see references/examples.md

Performance Optimization

📎 Code example 2 (tsx) — see references/examples.md

State Management Patterns

📎 Code example 3 (tsx) — see references/examples.md

Advanced Component Patterns

📎 Code example 4 (tsx) — see references/examples.md

Error Boundaries & Suspense

// Error boundary with fallback UI
class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
  state = { hasError: false, error: null };

  static getDerivedStateFromError(error: Error) {
    return { hasError: true, error };
  }

  componentDidCatch(error: Error, errorInfo: ErrorInfo) {
    console.error('Error caught by boundary:', error, errorInfo);
    // Send to error reporting service
  }

  render() {
    if (this.state.hasError) {
      return this.props.fallback?.(this.state.error) || <ErrorFallback />;
    }

    return this.props.children;
  }
}

// Suspense with error boundary
function DataComponent() {
  return (
    <ErrorBoundary fallback={(error) => <ErrorDisplay error={error} />}>
      <Suspense fallback={<LoadingSpinner />}>
        <AsyncDataFetcher />
      </Suspense>
    </ErrorBoundary>
  );
}

Testing Patterns

// Testing custom hooks
import { renderHook, act } from '@testing-library/react-hooks';

test('useCounter increments count', () => {
  const { result } = renderHook(() => useCounter());

  act(() => {
    result.current.increment();
  });

  expect(result.current.count).toBe(1);
});

// Component testing with React Testing Library
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

test('form submission works correctly', async () => {
  const handleSubmit = jest.fn();
  render(<ContactForm onSubmit={handleSubmit} />);

  const nameInput = screen.getByLabelText(/name/i);
  const emailInput = screen.getByLabelText(/email/i);
  const submitButton = screen.getByRole('button', { name: /submit/i });

  await userEvent.type(nameInput, 'John Doe');
  await userEvent.type(emailInput, 'john@example.com');
  await userEvent.click(submitButton);

  await waitFor(() => {
    expect(handleSubmit).toHaveBeenCalledWith({
      name: 'John Doe',
      email: 'john@example.com',
    });
  });
});

Form Handling

📎 Code example 5 (tsx) — see references/examples.md

Best Practices

  1. Use functional components and hooks
  2. Implement proper error boundaries
  3. Optimize re-renders with memo and callbacks
  4. Use proper key props in lists
  5. Implement code splitting
  6. Follow accessibility guidelines
  7. Write comprehensive tests

Performance Guidelines

  1. Virtualize long lists
  2. Lazy load components
  3. Optimize bundle size
  4. Use production builds
  5. Implement proper caching
  6. Monitor with React DevTools
  7. Profile and optimize bottlenecks

Output Format

When implementing React solutions:

  1. Use modern React patterns
  2. Implement proper TypeScript types
  3. Add comprehensive error handling
  4. Include performance optimizations
  5. Follow React best practices
  6. Add proper testing
  7. Use modern tooling

Always prioritize:

  • Component reusability
  • Performance optimization
  • Type safety
  • Accessibility
  • Developer experience

Reference Materials

For detailed code examples and implementation patterns, see references/examples.md.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

中国大陆AI保险顾问

中国大陆AI保险顾问。为个人和家庭提供全方位的保险咨询、产品对比、方案设计、投保指导。当用户询问保险配置、保险方案、产品对比、重疾险/医疗险/寿险/意外险/储蓄险推荐、保费计算、保障缺口分析、需求分析、核保合规、理赔等问题时使用。

Registry SourceRecently Updated
General

Four Dimensional Deep Reading

Simultaneously analyze books using 4 personas with multi-dimensional methods, producing structured insights on first principles, comparisons, and diverse per...

Registry SourceRecently Updated
General

🫧 Kling 3.0 — Pro Pack on RunComfy

Kling 3.0 video generation on RunComfy. Kling 3.0 (also called Kling V3.0) is Kuaishou Technology's third-generation multi-shot video model with native synch...

Registry SourceRecently Updated
General

App Builder

Full-stack application builder that creates web apps, APIs, mobile apps, and more from natural language requests. Use when the user wants to build a new appl...

Registry SourceRecently Updated