Skip to content

Instantly share code, notes, and snippets.

@velopert
Created September 4, 2016 15:37
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save velopert/8f22cf0830e65f6de8ae99808c5b92f5 to your computer and use it in GitHub Desktop.
Save velopert/8f22cf0830e65f6de8ae99808c5b92f5 to your computer and use it in GitHub Desktop.
React Component Snippet - rc
# 이 부분을 File - Snippet 에 들어가서 복사 & 붙여넣기 하세요.
'.source.js':
'React Component':
'prefix': 'rc'
'body': '''
import React, { Component, PropTypes } from 'react';
const propTypes = {
};
const defaultProps = {
};
class ${1:MyComponent} extends Component {
constructor(props) {
super(props);
}
render() {
return(
<div>${1:MyComponent}</div>
);
}
}
${1:MyComponent}.propTypes = propTypes;
${1:MyComponent}.defaultProps = defaultProps;
export default ${1:MyComponent};
'''
@lhy880518
Copy link

감사합니다.

@junotb
Copy link

junotb commented Dec 7, 2017

감사합니다!

@johnchoi87
Copy link

감사합니다! React 시작한지 얼마 안되었는데 많은 도움이 되고 있습니다.

@moonjong93
Copy link

Vs code 버전

"react first set":{
"prefix": "rc",
"body": [
"import React, { Component, PropTypes } from 'react'; ",

	"const propTypes = { };",

	"const defaultProps = { };",

	"class $1 extends Component { ",
		"\tconstructor(props) { ",
			"\t\tsuper(props)",
		"\t}",
		"\trender() {",
			"\t\treturn(",
				"\t\t\t<div>$1</div>",
			"\t\t);",
		"\t}",
	"}",
	"$1.propTypes = propTypes;",
	"$1.defaultProps = defaultProps",
	"export default $1;"
]

}

@LimEunSeop
Copy link

감사합니다.

@lsgsg
Copy link

lsgsg commented Jan 12, 2019

감사합니다 :D

@Tae-Hyeon
Copy link

감사합니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment