modern-best-practice-react-components

Refactor React components to enforce modern best-practice patterns.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/Mohamedghaly140/sg-shop-web --skill modern-best-practice-react-components-mohamedghaly140
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-best-practice-react-components
Source: https://github.com/Mohamedghaly140/sg-shop-web/tree/main/.claude/skills/modern-best-practice-react-components
Command: npx skills add https://github.com/Mohamedghaly140/sg-shop-web --skill modern-best-practice-react-components-mohamedghaly140

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

The skill guides developers to build clean, maintainable React components by applying modern patterns and avoiding common pitfalls like overuse of state, unnecessary effects, and tangled props.

Core Features & Use Cases

  • Focused, small components with clear responsibilities and explicit typing (TypeScript) where applicable.
  • Preference for function components, readable event handlers, and minimal side effects to improve maintainability.
  • Use cases include refactoring a legacy component, designing a component library, and enforcing consistent coding standards across a project.

Quick Start

Refactor a sample React component to align with modern best practices, emphasizing small, composable components, explicit props, and minimal effects.

Frequently Asked Questions about modern-best-practice-react-components

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

FAQPage Schema
How do I refactor React components to reduce unnecessary state and effects?

Refactor React components by decomposing them into small, focused units and applying modern best practices to minimize unnecessary state and tangled side effects. This approach ensures explicit typing and clear props documentation for maintainability.

What are modern best practices for TypeScript React component design?

Modern best practices for TypeScript React component design involve using named function components, declaring explicit return types, and maintaining clear props documentation. This ensures type correctness and improves overall frontend maintainability.

How do I enforce consistent coding standards across a React component library?

Enforce consistent coding standards across a React component library by applying patterns for controlled vs uncontrolled state, readable event handlers, and minimal side effects. This generates clean, composable components with clear responsibilities.

Does this approach work for refactoring legacy React components?

Yes, this approach works for refactoring legacy React components by untangling props and reducing overused state. It guides developers to align existing code with modern patterns, improving component decomposition and type correctness.

When should I use controlled vs uncontrolled state in React components?

Use controlled vs uncontrolled state in React components based on explicit best-practice patterns to ensure predictable data flow. Applying these rules reduces unnecessary effects and clarifies component responsibilities during frontend development.

Why does my React component have tangled props and how do I fix it?

Tangled props occur when components lack clear responsibilities and explicit typing. Fix this by decomposing into smaller, focused components and applying modern patterns to ensure minimal side effects and readable event handlers.