User Agents

React Extensions for VS Code: What to Install

The main extension for React development in Visual Studio Code is ES7+ React/Redux/React-Native snippets (published by dsznajder), usually shortened to "ES7+ React snippets." It adds shorthand prefixes like rafce, rfc, and useState that expand into full component and hook boilerplate. It is not the only extension worth installing, though: TypeScript support, linting, formatting, and debugging each come from separate extensions that work alongside it.

Why there is no single "official" React extension

Unlike some frameworks that ship a dedicated IDE plugin, React has no first-party VS Code extension maintained by the React team. React is a library, and VS Code already understands JavaScript and TypeScript natively. What React developers actually need is a set of small tools that handle different jobs:

  • Snippets to generate component scaffolding quickly.
  • Language intelligence for JSX, TypeScript types, and prop checking.
  • Linting to catch React-specific mistakes such as missing keys or hook rule violations.
  • Formatting so JSX indentation and line breaks stay consistent.
  • Browser debugging to inspect component trees and props at runtime.

That split is why searching "React extension" returns dozens of results, many of which overlap or are abandoned. The right setup is a small stack, not one magic plugin.

The core extensions most React projects use

A practical baseline for a React or Next.js project looks like this:

  • ES7+ React/Redux/React-Native snippets — component and hook snippets. The most-installed React-specific extension by a wide margin.
  • ESLint (by Microsoft) — surfaces errors from your project's ESLint config, including eslint-plugin-react-hooks warnings about conditional hooks.
  • Prettier - Code formatter — opinionated formatting for JSX, CSS, and JSON. Pairs with ESLint via eslint-config-prettier to avoid conflicting rules.
  • TypeScript and JavaScript Language Features — built in, no install needed. Handles JSX type checking, autocomplete on props, and go-to-definition.
  • Auto Rename Tag — renames the matching closing JSX tag as you type, which saves real time on nested markup.
  • React Developer Tools — technically a browser extension (Chrome, Edge, Firefox), not a VS Code extension, but essential for inspecting the component tree.

Optional additions depending on your stack: Tailwind CSS IntelliSense for utility-class autocomplete, Styled Components syntax highlighting, and Jest or Vitest extensions for running tests from the editor gutter.

How the snippet extension actually works

Snippets are triggered by typing a prefix inside a JavaScript or TypeScript file, then pressing Tab or Enter to expand. Common prefixes in ES7+ React snippets include:

  • rafce — arrow function component with a default export.
  • rfc — named function component.
  • rcc — class component with lifecycle scaffolding.
  • useState — a state hook declaration.
  • useEffect — an effect hook with a dependency array.
  • imr — imports React.
  • impt — imports PropTypes.

If a prefix does not expand, check the language mode in the bottom-right corner of the status bar. Snippets only fire in the languages the extension declares — usually JavaScript, JavaScript React, TypeScript, and TypeScript React. A file saved as .js but containing JSX may be treated as plain JavaScript, so the React snippets stay silent. Changing the mode to "JavaScript React" fixes it.

Choosing between similar extensions

Several extensions claim to do the same thing. A few practical filters:

  1. Check the publisher. Microsoft publishes ESLint, Prettier is published by Prettier, and snippets come from dsznajder. Lookalike names with odd publishers are usually forks.
  2. Check install counts and last update date. A React extension untouched for years may not understand newer syntax such as the automatic JSX runtime or React Server Components.
  3. Read the configuration section. Good extensions document their settings; vague ones often conflict with your project's own tooling.
  4. Avoid duplicates. Installing two formatters or two linters usually produces fighting rules and confusing squiggles.

A common misconception is that installing a React extension makes VS Code "support React." It does not — your project's package.json, tsconfig.json, and ESLint config do that. Extensions only surface and speed up what the toolchain already provides.

Common problems and fixes

  • Red squiggles everywhere after installing ESLint. The extension needs a config file in the workspace root. If ESLint is installed globally but not in the project, the extension may fail to resolve plugins. Install ESLint locally in the project and reload the window.
  • Formatting does nothing on save. Enable editor.formatOnSave in settings and set Prettier as the default formatter for the relevant languages.
  • Prettier and ESLint disagree. Add eslint-config-prettier last in your ESLint extends array so formatting rules are turned off in ESLint.
  • Snippets expand in the wrong place. Prefixes only trigger at the start of a word; typing inside an existing identifier will not expand.
  • Slow editor on large projects. Disable unused extensions per workspace rather than globally, and exclude build folders such as node_modules and dist from file watching.

Workspace settings worth knowing

VS Code stores project-specific settings in .vscode/settings.json, which can be committed so a team shares the same behaviour. Typical entries include the default formatter, format-on-save, ESLint validation languages, and snippet suggestions. Keeping these in the repository avoids the "works on my machine" formatting churn that shows up in pull request diffs.

Frequently Asked Questions

What is the best React extension for VS Code?

There is no single best one. ES7+ React/Redux/React-Native snippets is the most widely installed React-specific extension, but most developers pair it with ESLint and Prettier. The combination covers snippets, error checking, and formatting.

Do I need a React extension to write React in VS Code?

No. VS Code supports JSX and TypeScript out of the box. Extensions add convenience — snippets, linting, formatting — but nothing is strictly required to edit React files.

Why are my React snippets not working?

The most common cause is the file's language mode. Set it to JavaScript React or TypeScript React in the status bar. Also confirm the extension is enabled for the current workspace and that you are typing the prefix at the start of a word.

Is React Developer Tools a VS Code extension?

No. React Developer Tools is a browser extension for Chrome, Edge, and Firefox that adds a Components and Profiler tab to the browser's developer tools. It is separate from anything installed in VS Code.

Can I use these extensions with Next.js or React Native?

Yes. ESLint, Prettier, and the snippet extension all work in Next.js projects. For React Native, the same snippet pack includes React Native prefixes, though platform-specific tooling is handled by separate extensions.

Are React extensions free?

The extensions described here are free and open source. Some unrelated extensions in the marketplace charge for premium features, so check the listing before installing anything unfamiliar.