react-19

Refactor React components to remove manual useMemo and useCallback.

Updated Apr 9, 2025
One-click install
npx skills add https://github.com/D4nitrix13/dotfiles-tmp --skill react-19-d4nitrix13
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-19
Source: https://github.com/D4nitrix13/dotfiles-tmp/tree/main/.config/opencode/skill/react-19
Command: npx skills add https://github.com/D4nitrix13/dotfiles-tmp --skill react-19-d4nitrix13

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Avoids manual memoization and boilerplate by relying on the React Compiler to optimize components automatically.

Core Features & Use Cases

  • Server Components First: prefer server components for data fetching and defer client interactivity to client components.
  • Correct import patterns: emphasize named imports from React.
  • use() hook patterns for suspending promises and context-driven behavior.
  • Ref as Prop: treats ref as a normal prop rather than an actual React ref.

Quick Start

Refactor a React component to rely on compiler optimizations and remove all manual useMemo/useCallback usage.

Frequently Asked Questions about react-19

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop using manual memoization in React components?

You can eliminate manual memoization in React components by adopting React Compiler optimization patterns, removing all manual useMemo and useCallback usage, and using named imports for automatic rendering optimizations.

What is the correct import pattern for React 19 server components?

React 19 server components require using named imports from React rather than default imports, applying a server-components-first approach for data fetching while deferring interactivity to client components.

How do I use the use hook for promises and context in React 19?

The use hook in React 19 allows you to suspend promises and handle context-driven behavior directly within your components, replacing complex manual memoization logic for data transformations.

Can I pass ref as a normal prop in React 19 without forwardRef?

Yes, React 19 treats ref as a normal prop rather than an actual React ref, allowing you to pass it directly to components without needing forwardRef or manual callback ref memoization.

When should I avoid manual useMemo and useCallback in React lists?

You should avoid manual useMemo and useCallback in React lists, event handlers, and data transformations where memoization would be overkill, relying instead on the React Compiler for automatic optimizations.