react

Standardize React 19 component patterns with hooks, Suspense, and TypeScript.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/truongnat/emplus --skill react-truongnat
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react
Source: https://github.com/truongnat/emplus/tree/main/.agents/skills/react
Command: npx skills add https://github.com/truongnat/emplus --skill react-truongnat

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents slow, buggy, and inconsistent React implementations by standardizing how React 19 components, hooks, Suspense/lazy loading, and TypeScript patterns should be written.

Core Features & Use Cases

  • React 19 component patterns: Use function components with typed props, stable render behavior, and correct ref handling (no unnecessary forwardRef).
  • Hook best practices: Apply correct dependency management and safe state updates with useState, useEffect, useCallback, and useMemo.
  • Suspense & code splitting: Load heavy UI with React.lazy and wrap it with Suspense boundaries for graceful loading states.
  • Performance optimization: Reduce re-renders with React.memo and avoid inline handler creation that defeats memoization.
  • TypeScript correctness: Model props/state with interfaces, type-safe hooks, and predictable component typing.

Use Case Example: When building a mobile-first UI, implement a dashboard that lazy-loads expensive charts, shows skeleton fallbacks with Suspense, and keeps handlers stable to minimize unnecessary re-renders.

Quick Start

Use the react skill to design a React 19 TypeScript component with hooks, an appropriate Suspense boundary for a lazy-loaded subcomponent, and a performance plan that avoids avoidable re-renders.

Frequently Asked Questions about react

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

FAQPage Schema
How do I prevent unnecessary re-renders in React components?

Prevent unnecessary React re-renders by applying React.memo to components and keeping handler functions stable, which stops inline handler creation from defeating memoization during the render cycle.

What is the best way to lazy load heavy UI components with Suspense in React 19?

The best way to lazy load heavy UI components in React 19 is to use React.lazy for code splitting and wrap the dynamically imported modules with Suspense boundaries to display graceful loading fallbacks.

How do I manage useEffect dependency lists correctly in TypeScript React hooks?

Manage useEffect dependency lists correctly by including all reactive values used inside the effect, ensuring safe state updates, and applying type-safe hook patterns to maintain predictable component behavior.

Do I need forwardRef for React 19 component patterns?

You do not need forwardRef for React 19 component patterns, as the standard implementation practices now support stable render behavior and correct ref handling without requiring unnecessary forwardRef wrappers.

Why does code splitting with React.lazy show a blank screen instead of a loading state?

Code splitting with React.lazy shows a blank screen when the lazy-loaded component is not wrapped in a Suspense boundary, which is required to render graceful loading fallbacks during async loading.

Can I use TypeScript interfaces to model props and state for React hooks?

You can use TypeScript interfaces to model props and state for React hooks, applying type-safe conventions to ensure predictable component typing and maintainable feature modules.