- Go to VSCode, click CMD+Shift+P
- Enter:
Preferences: Configure User Snippets
- Choose
typescriptreact.json
- Copy the "ReactComponent" property from the
typescriptreact.json
file to your clipboard - Paste
- Enjoy
Last active
June 14, 2020 15:00
-
-
Save eyalcohen4/c52501e86c0f78ed4c21bb63fee751d5 to your computer and use it in GitHub Desktop.
React TypeScript Component Snippet
This file contains hidden or 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
{ | |
"ReactComponent": { | |
"prefix": "comp", | |
"body": [ | |
"import React from 'react';", | |
"", | |
"type $1Props = {", | |
"", | |
"}", | |
"const $1: React.FC<$1Props> = ({}: $1Props) => {", | |
" return <div className='$2' />", | |
"}", | |
"", | |
"export default $1" | |
], | |
"description": "react component" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment