Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>ES7/React-SnippetsNew to Visual Studio Code? Get it now.
ES7/React-Snippets

ES7/React-Snippets

naqvi

|
45,639 installs
| (0) | Free
A Simple Extension For React
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VS Code ES7 React snippets

JavaScript and React/Redux snippets in ES7+ with Babel plugin features for VS Code

Installation

Installation

Visual Studio Marketplace

Launch Quick Open:

  • Linux: Ctrl+P
  • macOS: ⌘P
  • Windows: Ctrl+P

Paste the following command and press Enter:

ext install naqvi.es7-react-snippets

Visual Studio Marketplace

Launch Quick Open:

  • Linux: Ctrl+P
  • macOS: ⌘P
  • Windows: Ctrl+P

Supported languages (file extensions)

  • JavaScript (.js)
  • JavaScript React (.jsx)

Snippets info

Every space inside { } and ( ) means that this is pushed into next line :) $ represent each step after tab.

React 17 is currently supported by _ prefix.

React

Prefix Description
cfc→ create react functional component
ccc→ create react class component
cafc→ create arrow functional component
cpc→ create pure component
cmc→ create memo component

Imports

Prefix Description
impd→ import default export
impn→ import named export

React lifeCycle Methods

Prefix Description
ccdm→ create componentDidMount method
cscu→ create shouldComponentUpdate method
ccdu→ create componentDidUpdate method
ccwu→ create componentWillUnmount method
cgd→ create getDerivedStateFromProps method
cgsbu→ create getSnapshotBeforeUpdate method
crc→ create react constructor component

React Hooks

Prefix Description
us→ useState hook
ue→ useEffect hook

React Components

cfc

import React from 'react'

export default function Example() {
    return (
        <div>
            
        </div>
    )
}

ccc

import React, { Component } from 'react'

export default class Example extends Component {
    render() {
        return (
            <div>
                
            </div>
        )
    }
}

cafc

import React from 'react'

export const Example = () => {
    return (
        <div>
            
        </div>
    )
}

cpc

import React, { PureComponent } from 'react'

export class Example extends PureComponent {
    render() {
        return (
            <div>
                
            </div>
        )
    }
}

cmc


import React, { memo } from 'react'

const Example = memo(function Example(props) {
    return (
        <div>
            
        </div>
    )
})
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft