react

Enforce clean React component patterns in TypeScript codebases.

3|Updated Aug 17, 2020
One-click install
npx skills add https://github.com/d-kimuson/dotfiles --skill react-d-kimuson
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react
Source: https://github.com/d-kimuson/dotfiles/tree/main/claude-code/skills/react
Command: npx skills add https://github.com/d-kimuson/dotfiles --skill react-d-kimuson

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill captures React coding guidelines focusing on minimal useEffect, explicit event handling, and predictable component patterns.

Core Features & Use Cases

  • Best-practice patterns: Emphasizes minimal useEffect, strong FC typing, and proper data fetching strategies.
  • API request guidance: Encourages using query clients over direct fetch calls.
  • Code quality: Provides patterns to improve readability and maintainability.

Quick Start

Convert a simple component using useEffect into a declarative, event-driven version with explicit handlers.

Frequently Asked Questions about react

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

FAQPage Schema
How do I write React components with minimal useEffect and better data fetching?

Minimal useEffect in React is achieved by using event handlers and query clients (Apollo, TanStack, SWR) instead of direct fetch calls in components. This approach reduces side effects, improves predictability, and keeps components declarative and easier to test.

What's the best way to handle data fetching in React components?

Use dedicated query clients like Apollo, TanStack Query, or SWR instead of direct fetch calls within components. These libraries manage caching, loading states, and refetching, eliminating the need for complex useEffect patterns and improving code maintainability.

Should I use function declarations or arrow functions for React components in TypeScript?

Use functional component (FC) typing with arrow functions in TypeScript React. This provides strong type annotations, prevents accidental function declaration patterns, and ensures consistent component signatures across your codebase.

Can I call fetch directly inside React components?

Direct fetch calls in React components should be avoided in favor of query clients. Fetch within components creates side effects, complicates dependency tracking, and leads to harder-to-maintain code; query clients handle these concerns more reliably.

What are the benefits of enforcing React code patterns across a codebase?

Enforcing patterns like minimal useEffect, FC typing, and prescribed API workflows ensures consistency, reduces bugs from incorrect side-effect handling, improves code readability, and makes reviews and maintenance faster across teams.

Does this approach work with TypeScript and modern React?

Yes, this guidance is built for modern React with TypeScript, emphasizing FC type annotations, event-driven patterns, and integration with contemporary data-fetching libraries like Apollo, TanStack Query, and SWR.