VS Code react插件

ES7 React/Redux/GraphQL/React-Native snippets

安裝後輸入指令生成對應code:

rafce:

import React from 'react'

const MainContent = () => {
  return (
    <div>
      
    </div>
  )
}

export default MainContent

 

 

rfc:

import React from 'react'

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

 

rce:

import React, { Component } from 'react'

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

export default MainContent

rccp:

import React, { Component } from 'react'
import PropTypes from 'prop-types'

export default class MainContent extends Component {
  static propTypes = {
    prop: PropTypes
  }

  render() {
    return (
      <div>
        
      </div>
    )
  }
}