Created
February 25, 2019 09:32
-
-
Save StrongerMyself/f89d6b461507c5626c6ad05de9245ad3 to your computer and use it in GitHub Desktop.
vs-code jsx snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"jsx-component": { | |
"prefix": "jsx-component", | |
"body": [ | |
"import React, { Component } from 'react'", | |
"import PropTypes from 'prop-types'", | |
"", | |
"import c from './${2:style}.style.sass'", | |
"", | |
"export default class ${1:component} extends Component {", | |
"", | |
" static propTypes = {", | |
" name: PropTypes.string,", | |
" }", | |
"", | |
" static defaultProps = {", | |
" name: '-',", | |
" }", | |
"", | |
" render() {", | |
" let { name } = this.props", | |
" return (", | |
" <div className={c.${3:class}}>", | |
" {name}", | |
" </div>", | |
" )", | |
" }", | |
"}", | |
], | |
"description": "React template component" | |
}, | |
"React import BrowserRouter libs": { | |
"prefix": "react-router-lib", | |
"body": [ | |
"import { ${1:BrowserRouter as }${2:Router, }${3:Route, }${4:Link, }${5:NavLink} } from 'react-router-dom'$0" | |
], | |
"description": "React import BrowserRouter libs" | |
}, | |
"React styled init": { | |
"prefix": "react-styled", | |
"body": [ | |
"import styled from 'styled-components'", | |
"// import { Link } from 'react-router-dom'", | |
"", | |
"export const ", | |
" ${1:Elem} = styled.div`", | |
" $2", | |
" `${3:,}", | |
" $0", | |
], | |
"description": "React import BrowserRouter libs" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment