writing-react

Enforce React component patterns, state management, and JSX optimization.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/anthony-fdez/claude-skills --skill writing-react
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-react
Source: https://github.com/anthony-fdez/claude-skills/tree/main/.claude/skills/writing-react
Command: npx skills add https://github.com/anthony-fdez/claude-skills --skill writing-react

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces best practices for writing React components, preventing common anti-patterns and ensuring maintainable, efficient, and scalable code.

Core Features & Use Cases

  • Component Structure: Guides the organization of components into hooks, handlers, and render sections.
  • State Management: Prevents syncing props to state and storing computed values.
  • useEffect Best Practices: Discourages using useEffect for events or data fetching, promoting React Query instead.
  • JSX Optimization: Encourages extracting complex conditionals and render functions into separate components.
  • Use Case: When developing a new feature with multiple interconnected components, this skill ensures that state is managed effectively, side effects are handled correctly, and the codebase remains clean and easy to understand.

Quick Start

Apply the writing-react skill to refactor the provided React component to adhere to the specified patterns.

Frequently Asked Questions about writing-react

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

FAQPage Schema
What are the best practices for organizing React component logic and structure?

Organizing React components involves separating hooks, handlers, and render sections to ensure maintainable and scalable code. This structure prevents common anti-patterns by keeping state management and side effects cleanly isolated from rendering logic.

How do I prevent syncing props to state in React components?

To prevent syncing props to state in React components, avoid storing computed values derived from props directly in state. Instead, calculate these values during render or memoize them to ensure state synchronization does not trigger unnecessary re-renders.

Should I use useEffect for data fetching in React?

You should not use useEffect for data fetching in React. Instead, use dedicated data-fetching libraries like React Query to handle caching, synchronization, and loading states, effectively preventing side-effect anti-patterns in your components.

How do I optimize complex JSX conditionals in React components?

Optimize complex JSX conditionals by extracting them into separate components rather than using inline render functions. This approach improves code readability and maintainability while ensuring your React component structure remains clean and scalable.

Can this React component refactoring approach handle TypeScript and JavaScript projects?

Yes, this refactoring approach handles both TypeScript and JavaScript frontend projects. It enforces React component patterns, state management rules, and hook usage best practices regardless of whether you use TypeScript or standard JavaScript.