Description
vim-react-snippets is a collection of React snippets for Vim, written for JavaScript and TypeScript code. The snippets use LuaSnip as their snippet engine, so you type a short trigger and expand it into a full block of code. The cheatsheet covers function components in several export styles, server components, and hooks such as useState, useReducer, useEffect, useContext, useCallback, useMemo, useRef and useId. It also includes a context provider, Redux hooks, and common code shapes such as destructured constants, if, switch and loop blocks. TypeScript snippets cover interfaces, optional properties and type parameters, and JSDoc or TSDoc blocks cover documentation comments. Test templates include describe and it blocks, expect, test queries, user events, waitFor and React test files. SCSS and Material UI snippets are included too. The README has an installation section, a TypeScript example, notes on previewing snippets and writing tests, and a section on contributing.…
Highlights
- React function and server component snippets
- Hook snippets for state, effects, context and refs
- TypeScript interfaces, generics and JSDoc
- Test templates for React components
- SCSS and Material UI snippets
Ratings & Reviews
No ratings yet
Be the first to rate Vim React Snippets.
People also visit
Vim React Snippets FAQ
What are these snippets?
Vim snippets for writing React code in JavaScript and TypeScript. They use the LuaSnip snippet engine.
What do I need to install first?
LuaSnip, since the snippets rely on it as their snippet provider. The README has the installation steps.
Which React features are covered?
Function and server component exports, hooks such as useState, useReducer, useEffect and useMemo, context providers, and Redux hooks.
Are there testing snippets?
Yes. There are templates for describe and it blocks, expect, test queries, user events, waitFor and React test files.
What are the best Vim React Snippets alternatives?
Popular alternatives to Vim React Snippets include React Markdown Editor, Coc Snippets and React MD Editor. See all Vim React Snippets alternatives















