Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. ESLint
  3. React Refresh

React Refresh

MITTypeScriptv0.5.3

An ESLint plugin that validates React components can safely update with Fast Refresh (hot reloading).

GitHubGitHub
335 stars22 forks0 contributors

What is React Refresh?

eslint-plugin-react-refresh is an ESLint plugin that validates whether React components are structured correctly to work with Fast Refresh (hot reloading). It ensures that only valid React components are exported from files, preventing runtime errors during development when components are updated. The plugin helps maintain compatibility with modern bundlers like Vite and Next.js.

Target Audience

React developers using Fast Refresh in projects with Vite, Next.js, or similar bundlers, especially those working on larger codebases where hot reloading reliability is critical.

Value Proposition

Developers choose this plugin to catch Fast Refresh issues early in development, avoiding cryptic runtime errors. It provides framework-specific configurations and customizable rules to fit different project needs without false positives.

Overview

Validate that your components can safely be updated with Fast Refresh

Use Cases

Best For

  • Ensuring Fast Refresh works reliably in Vite React projects
  • Preventing hot reloading errors in Next.js applications
  • Linting React codebases to enforce component-only exports
  • Configuring ESLint for modern React development workflows
  • Avoiding anonymous function exports that break HMR
  • Validating component structures in TypeScript React projects

Not Ideal For

  • Projects not using Fast Refresh or hot reloading (e.g., legacy bundlers or disabled HMR)
  • React codebases with many class components or anonymous function exports
  • Applications that rely heavily on `export *` syntax for module aggregation
  • Teams working with `.js` files for JSX without consistent React imports

Pros & Cons

Pros

Fast Refresh Validation

Enforces that only React components are exported, preventing runtime errors during hot reloads, as shown in the examples that flag non-component exports.

Framework-Specific Configurations

Provides pre-configured rules for Vite and Next.js, such as allowing constant exports for Vite or specific exports like fetchCache for Next.js, reducing setup effort.

Customizable Rule Options

Offers options like extraHOCs and allowExportNames to adapt to different project setups, letting teams whitelist HOCs or framework-specific exports without false positives.

Clear Error Prevention

Flags problematic patterns like anonymous functions and export * early in development, helping avoid cryptic HMR failures that can waste debugging time.

Cons

Limited to Functional Components

Does not support class components, which excludes legacy or certain React codebases, as admitted in the README under limitations.

Naming Convention Dependency

Relies on PascalCase for components, causing errors with all-uppercase exports or unconventional naming, which can be restrictive for some coding styles.

Restricts Export Patterns

Prohibits common patterns like export * and anonymous functions, forcing refactoring in projects that use these for module organization or concise code.

Frequently Asked Questions

Quick Stats

Stars335
Forks22
Contributors0
Open Issues5
Last commit1 month ago
CreatedSince 2022

Tags

#developer-tools#hot-reloading#nextjs#hmr#vite#eslint-plugin#eslint#react#linting#react-components

Included in

ESLint4.7k
Auto-fetched 8 hours ago

Related Projects

React HooksReact Hooks

The library for web and native user interfaces.

Stars246,691
Forks51,164
Last commit7 hours ago
MeteorMeteor

Meteor, the JavaScript App Platform

Stars44,802
Forks5,242
Last commit14 hours ago
ReactReact

React-specific linting rules for ESLint

Stars9,289
Forks2,733
Last commit2 months ago
VueJSVueJS

Official ESLint plugin for Vue.js

Stars4,592
Forks715
Last commit19 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub