Created
September 12, 2022 18:18
-
-
Save LeonidasEsteban/64329ede20403104c99e83c5df9fc04e to your computer and use it in GitHub Desktop.
React Functional Component & React Functional Styled Component 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
{ | |
"reactFunctionalComponent": { | |
"prefix": "rfc", | |
"body": [ | |
"", | |
"function ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}() {", | |
"\treturn (", | |
"\t\t<${1:${div}}>", | |
"\t\t\t${2:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}}", | |
"\t\t</${1:${div}}>", | |
"\t)", | |
"}", | |
"", | |
"export default ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}", | |
"" | |
], | |
"description": "Creates a React Functional Component with Styled Component" | |
}, | |
"reactFunctionalStyledComponent": { | |
"prefix": "rsfc", | |
"body": [ | |
"import styled from 'styled-components'", | |
"", | |
"const ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Styled = styled.${1:div}`", | |
"", | |
"`", | |
"", | |
"function ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}() {", | |
"\treturn (", | |
"\t\t<${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Styled>", | |
"\t\t\t${2:${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}}", | |
"\t\t</${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}Styled>", | |
"\t)", | |
"}", | |
"", | |
"export default ${TM_FILENAME_BASE/(.*)/${1:/pascalcase}/g}", | |
"" | |
], | |
"description": "Creates a React Functional Component with Styled Component" | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment