react-development

Enforce React 19 best practices for TypeScript component development.

1|Updated Feb 19, 2025
One-click install
npx skills add https://github.com/trystan2k/favoritable-old --skill react-development-trystan2k
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-development
Source: https://github.com/trystan2k/favoritable-old/tree/main/.agents/skills/react-development
Command: npx skills add https://github.com/trystan2k/favoritable-old --skill react-development-trystan2k

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the risk of writing outdated, inconsistent React code that misses modern React 19 features and best practices, which can lead to performance bottlenecks, bugs, and unmaintainable component architectures.

Core Features & Use Cases

  • React 19 Pattern Guidance: Covers Server Components, the use hook, Actions, useActionState, ref as prop, and modern effect/ref best practices.
  • Convention References: Includes specific guides for TypeScript type imports, component file naming, CSS Module styling, avoiding barrel file imports, component interface typing, and stabilizing JSX prop functions with useCallback.
  • Use Case: For example, when building a new bookmark display feature for the favoritable app, use this skill to ensure components default to Server Components, use proper TypeScript prop types, and avoid performance pitfalls like inline function props.

Quick Start

Use the react-development skill to build a Server Component that fetches and displays a user's saved bookmarks with label-based filtering, adhering to all outlined best practices.

Frequently Asked Questions about react-development

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

FAQPage Schema
How do I write React 19 components using best practices?

To write React 19 components using best practices, default to Server Components, apply the `use` hook, use `useActionState` for Actions, and pass refs as props. Ensure correct hook usage and TypeScript prop typing for maintainable architectures.

What are modern React 19 best practices for Server Components?

Modern React 19 Server Component best practices involve adopting server-side rendering by default, avoiding barrel file imports for bundle performance, and using CSS Modules. You should also ensure proper TypeScript type imports and component interface typing.

How do I stabilize JSX prop functions with useCallback in React?

To stabilize JSX prop functions in React, wrap them with the `useCallback` hook to prevent unnecessary re-renders. This effect synchronization technique avoids performance bottlenecks commonly caused by inline function props in TypeScript React applications.

Does this React development approach support TypeScript prop typing?

Yes, this React development approach fully supports TypeScript prop typing by enforcing standard conventions for type imports and component interfaces. It ensures correct TypeScript prop definitions for modern React 19 components.

How do I avoid performance bottlenecks in React component creation?

To avoid performance bottlenecks in React component creation, eliminate inline function props by stabilizing them with `useCallback` and avoid barrel file imports. Following modern React 19 best practices ensures optimized bundle performance and effect synchronization.

Why should I use `useActionState` for Actions in React 19?

You should use `useActionState` for Actions in React 19 because it enforces modern best practices for state management within form submissions. This convention eliminates outdated, non-performant code and ensures correct effect synchronization.