Skip to content

Latest commit

 

History

History
89 lines (66 loc) · 2.8 KB

README.md

File metadata and controls

89 lines (66 loc) · 2.8 KB

React Snippets for Visual Studio Code

Extension for Visual Studio Code to add snippets for React in ECMAScript 6.

Extension demo

Usage

Type the snippet prefix and press enter.

  • General
u-ci                // console.info|log|error
u-cn                // JSX element class name
u-ctor              // Class constructor
u-impt              // Import module statement
u-rcc               // Class component (stateful)
u-rfc               // Functional component (stateless)
  • PropTypes
u-pt                // Generic PropType (string|number|func|...)
u-pta               // Array PropType
u-ptany             // Any PropType
u-ptarrayof         // Array Of (PropType)
u-ptb               // Bool PropType
u-ptcustom          // Custom PropType
u-ptcustomarrayof   // Custom ArrayOf PropType
u-pte               // Element PropType
u-ptf               // Func PropType
u-ptinstanceof      // Instance Of (PropType)
u-ptn               // Number PropType
u-ptnode            // Node PropType
u-pto               // Object PropType
u-ptobjectof        // Object Of (PropType)
u-ptoneof           // One Of (PropType)
u-ptoneoftype       // One Of Type (PropType)
u-pts               // String PropType
u-ptshape           // Shape PropType
u-ptsymbol          // Symbol PropType
  • Redux
u-actions           // Redux actions (including import statements)
u-action            // Redux action
  • Testing
u-it                // Jest test `it`
u-desc              // Jest test `describe`
u-suite             // Jest test suite (including import statements)
u-afterEach         // Jest afterEach function
u-beforeEach        // Jest beforeEach function

Installation

Install through VS Code extensions. Search for UruIT React Snippets

Visual Studio Code Market Place: UruIT React Snippets

Can also be installed using

ext install uruit-react-snippets

Troubleshooting

If the snippets prefixes do not show up when typing them, make sure you have the tab-completion enabled in your settings: "editor.tabCompletion": true.

Alternatively, you can choose Insert Snippet in the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Windows or Linux).

Author

Contributors