Typescript + React UserSnippet

KyungminLee·2021년 3월 28일
0
post-thumbnail
post-custom-banner

1. vscode user snippet

1. code > Preferences > usersnippet

2. typescriptreact.json/typescript.json 열기

3. prefix, body,description 추가

"Create function component": {
  	"prefix": "fc",
 	"body": [
   	"interface ${TM_FILENAME_BASE}Props{}",
 	"",
	"const ${TM_FILENAME_BASE}: React.FC<${TM_FILENAME_BASE}Props> = ({}) => {",
 	"  return <div>${TM_FILENAME_BASE}</div>",
 	"}",
  	"",
 	"export default ${TM_FILENAME_BASE}",
  	""
 	],
 	"description": "Create function component"
},
profile
끊임없이 발전해가는 개발자.
post-custom-banner

0개의 댓글