Code snippets for React 17/18+ in ES6+ syntax and the JavaScript Standard Style. It is very basic but additional snippets can be added if requested.
Add React snippets that:
- excludes
import React from 'react'
, beginning with React 17, bundlers now can use JSX transform without importingReact
. - excludes Class components, Functional components is now the best and default way to create React components.
- excludes Semicolons, JavaScript automatically insert semicolons to terminate statements.
- using interfaces for prop types in TypeScript.
Use ESLint, TypeScript ESLint, and a formatter
(like Prettier) after adding snippets to conform to your
coding style. Additionally add "source.addMissingImports": "explicit"
to
"editor.codeActionsOnSave"
in your vscode settings to add imports.
Check out the changelog for release.
Modern React Snippets is licensed under the MIT License.