Customizable JavaScript and React/Redux snippets for VS Code, with first-class support for ES7+ syntax, React 17–19, React Router v6, Redux Toolkit, and TypeScript.
Maintained by r5n. Continues the work of the original
vscode-es7-javascript-react-snippetsextension. The legacyes7-react-js-snippetslisting is deprecated; installr5n.es-js-snippetsfor new updates.
Open VS Code Quick Open and paste:
ext install r5n.es-js-snippetsQuick Open shortcut: Ctrl+P (Linux/Windows) · ⌘P (macOS).
Or from the Marketplace: r5n.es-js-snippets · Open VSX: open-vsx.org.
Search by description or prefix:
| Action | Shortcut |
|---|---|
| Snippet search | ⇧⌘R (macOS) · Ctrl+Alt+R (Win/Linux) |
| Command palette | "Snippet search" |
The full list lives in docs/Snippets.md.
- React 17–19 support — components no longer add
import Reactby default (toggle viaimportReactOnTop). - React Router v6 imports.
- Redux Toolkit (
createSlice,createApi/ RTK Query) snippets. - Performance: snippet generation no longer mutates source on settings reload, fixing stale snippets after toggling options.
languageScopesis validated; invalid scopes are dropped instead of silently breaking activation.
See CHANGELOG.md for the full list.
Settings live under reactSnippets.settings.*. Restart VS Code after changes.
| Setting | Type | Default | Description |
|---|---|---|---|
importReactOnTop |
boolean |
false |
Add import React from 'react' to component snippets. Enable for projects on the legacy JSX transform. |
typescript |
boolean |
true |
Emit TypeScript Props typing in component snippets. |
languageScopes |
string |
typescript,typescriptreact,javascript,javascriptreact |
Comma-separated language scopes where snippets are active. |
typescriptPropsStatePrefix |
string |
type |
Use type or interface for Props/State in TypeScript snippets. |
Install from Marketplace (VS Code, Cursor) or Open VSX (VSCodium, Theia, Eclipse Che).
vim / neovim with coc.nvim
Add the plugin in your init.vim:
Plug 'r5n/vscode-react-javascript-snippets', { 'do': 'bun install --frozen-lockfile && bun run compile' }Reload (:source %) and run :PlugInstall.
use {
'r5n/vscode-react-javascript-snippets',
run = 'bun install --frozen-lockfile && bun run compile'
}Save (:w) to trigger the build.
Local stack: bun ≥ 1.3 + VS Code.
git clone https://github.com/r5n/vscode-react-javascript-snippets
cd vscode-react-javascript-snippets
bun install
bun run typescript # type-check
bun run lint # eslint
bun run compile # build to ./libPress F5 in VS Code to launch the Extension Development Host with the local build attached.
Open a PR against develop. CI (Typescript & lint) runs on every push and pull request.
Releases publish to VS Code Marketplace and Open VSX via GitHub Actions:
- Trigger the Release workflow in the Actions tab and pick a version bump (
prerelease,patch,minor,major) or pass an explicit semver (5.0.0-rc.2). - The workflow runs lint + tsc, packages with
vsce package, publishes withvsce publishandovsx publish(auto-detects--pre-releasefor-rc/-betaversions), pushes the tag, and creates a GitHub Release with the.vsixattached. - Required repo secrets:
VSCE_PAT(Azure DevOps PAT scoped to ther5nMarketplace publisher),OVSX_PAT(Open VSX namespace token).