Sentry Answers>React>

Warning: React version not specified in 'eslint-plugin-react settings' while running eslint on top of React 18.2.0

Warning: React version not specified in 'eslint-plugin-react settings' while running eslint on top of React 18.2.0

Matthew C.

The Problem

When using the eslint-plugin-react ESLint plugin, which adds React-specific linting rules to ESLint, you may encounter the following warning:

Click to Copy
Warning: React version not specified in eslint-plugin-react settings.

The Solution

This warning occurs if you haven’t added the React version to your eslint-plugin-react configuration settings. When the React version hasn’t been specified in your eslint-plugin-react settings, eslint-plugin-react defaults to using the latest React version for linting, which may lead to incorrect ESLint warnings or errors if you aren’t using the latest React version.

Specify which React version you’re using in your eslint-plugin-react configuration settings. If you’re using the new ESLint configuration system, modify your eslint.config.js, eslint.config.mjs, or eslint.config.cjs ESLint configuration file to include the React version:

Click to Copy
export default [ { settings: { react: { version: "detect", // ... }, }, // ... plugins: ["react"], // ... }, ];

When you specify “detect” as the React version, eslint-plugin-react automatically uses the React version of your project. You can also set a React version number, such as 16.0, if you want to override the detected value.

The new configuration system was added in ESLint version 8.21.0. This new system doesn’t use the legacy .eslintrc config file name and instead uses eslint.config.js as the new default config file name. From ESLint version 9 onwards, only the new system is supported.

If you’re using an older ESLint version, update your .eslintrc file to include the React version:

Click to Copy
{ "settings": { "react": { "version": "detect" // ... }, // ... "plugins": [ "react" ] // ... } }

The React default version is configurable from eslint-plugin-react version 7.35.0.

Note

The React version not specified in eslint-plugin-react settings. warning was added to eslint-plugin-react version 7.12.0 in response to this GitHub issue: React 16 lifecycle errors appearing in a React 15 project.

  • Sentry BlogGuide to Error & Exception Handling in React
  • Sentry BlogHow to identify fetch waterfalls in React
  • Syntax.fmReact Server Components
  • Sentry BlogSentry can’t fix React hydration errors, but it can really help you debug them
  • Syntax.fmWhy the jQuery Creator Uses React and Typescript
  • Syntax.fmListen to the Syntax Podcast
  • Sentry BlogReact Native Debugging and Error Tracking During App Development
  • Syntax.fmDiscussion on building native iOS and Android apps with React Native
  • SentryReact Error & Performance Monitoring
  • Sentry BlogFixing memoization-breaking re-renders in React
  • SentryReact Debug Hub
  • Syntax.fm logo
    Listen to the Syntax Podcast

    Tasty treats for web developers brought to you by Sentry. Get tips and tricks from Wes Bos and Scott Tolinski.

    SEE EPISODES

Considered “not bad” by 4 million developers and more than 100,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.

© 2025 • Sentry is a registered Trademark of Functional Software, Inc.