react

Applies React 19 and Next.js best practices for component design and data fetching.

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill react-maicongambini
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react
Source: https://github.com/MaiconGambini/opencode-harness-guide/tree/main/skills/react
Command: npx skills add https://github.com/MaiconGambini/opencode-harness-guide --skill react-maicongambini

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Modern React codebases often accumulate anti-patterns like data fetching inside useEffect, magic strings for cache keys, and impure components, leading to bugs and poor performance. This Skill enforces React 19 and Next.js conventions so generated or reviewed code follows current standards. ## Core Features & Use Cases - React 19 Patterns: Promotes Suspense, the use hook, useTransition, and startTransition over legacy useEffect-based approaches. - Data Fetching Standards: Directs usage of React Query with useSuspenseQuery instead of manual isLoading handling or fetching in useEffect. - Cache & Component Hygiene: Enforces enum/factory-based cache keys, pure components, and error boundaries with retry buttons. - Use Case: When asking an AI to build a Next.js page that loads user data, this Skill ensures the output uses Suspense boundaries and React Query rather than useEffect fetching. ## Quick Start Review my Next.js component and rewrite it to follow React 19 best practices with Suspense and React Query.

Frequently Asked Questions about react

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

FAQPage Schema
How do I fetch data in React 19 without useEffect?

Use React Query with useSuspenseQuery for client-side async data, or pass promises as props and unwrap them with the use hook. This avoids manual loading state management and race conditions common in useEffect fetching.

What are React 19 best practices for loading states?

Prefer Suspense boundaries with useSuspenseQuery over checking isLoading flags from React Query. Wrap async UI sections in <Suspense> components so React handles fallback rendering declaratively.

Should I use useEffect in React 19 components?

In most cases no. React 19 favors use, useTransition, and startTransition for async work, and React Query for server state. Reserve useEffect only for genuine synchronization with external systems.

How do I manage React Query cache keys without magic strings?

Define cache keys through an enum or a key factory function instead of inline string literals. This centralizes cache tags, prevents typos, and makes invalidation targets consistent across the codebase.

When should I not use Suspense for data fetching?

Avoid Suspense when you need fine-grained control over loading sequences or when the data fetching library lacks suspense support. In those cases, traditional isLoading patterns with React Query remain appropriate.