react-fast-refresh-exports

Enforce React component-only exports in TSX files with ESLint.

Updated Mar 11, 2026
One-click install
npx skills add https://github.com/holblin/webapp-template --skill react-fast-refresh-exports
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-fast-refresh-exports
Source: https://github.com/holblin/webapp-template/tree/main/.agents/skills/react-fast-refresh-exports
Command: npx skills add https://github.com/holblin/webapp-template --skill react-fast-refresh-exports

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the issue of improper exports in React component files, which can lead to inconsistent behavior and maintenance challenges in React projects.

Core Features & Use Cases

  • Enforces Proper Exports: Ensures only React components are exported from *.tsx files, preventing accidental exports of non-component code.
  • Organizes Code Structure: Guides developers to move GraphQL documents and constants into sibling files, improving code modularity.
  • Use Case: During a React project refactor, enforce export rules to improve component reusability and prevent accidental leaks of utility functions or constants.

Quick Start

Use the Skill to audit all React component files and identify violations, then apply recommended restructuring instructions.

Frequently Asked Questions about react-fast-refresh-exports

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

FAQPage Schema
How do I prevent non-component exports in React TypeScript files?

You can prevent non-component exports in React by enforcing rules that restrict .tsx files to component-only exports. This involves moving utility functions, constants, and GraphQL documents into sibling files to maintain strict boundaries and improve modularity.

Why should I separate constants and GraphQL documents from React component exports?

Separating constants and GraphQL documents from React component exports prevents inconsistent behavior and maintenance challenges. Organizing non-component code into dedicated sibling files improves overall project code quality, component reusability, and prevents accidental leaks of utility functions during refactoring.

How to audit a React project for improper component exports and refactor them?

To audit React component exports, use an ESLint-based approach to scan .tsx files and identify violations where non-component code is exported. Apply recommended restructuring instructions to move the misplaced code into dedicated sibling files, improving project modularity.

Does this React export enforcement approach require ESLint and file manipulation?

Yes, enforcing proper React component exports requires ESLint to detect violations and file manipulation to relocate non-component code. This combination ensures safe project maintenance by guiding developers to move constants and GraphQL documents into dedicated sibling files.

Can I use ESLint to enforce that only React components are exported from .tsx files?

Yes, you can use ESLint to enforce that only React components are exported from .tsx files. This configuration identifies non-component exports and provides restructuring instructions to move them into sibling files, ensuring clean component architecture.

What is the best way to organize React component files during a large project refactor?

The best way to organize React component files during a refactor is enforcing strict export rules. Ensure only components are exported from .tsx files while moving constants, utilities, and GraphQL documents into sibling files to maximize modularity and prevent accidental code leaks.