Skip to content

Instantly share code, notes, and snippets.

@LeonidasEsteban
Created September 12, 2022 18:18
Show Gist options
  • Save LeonidasEsteban/64329ede20403104c99e83c5df9fc04e to your computer and use it in GitHub Desktop.
Save LeonidasEsteban/64329ede20403104c99e83c5df9fc04e to your computer and use it in GitHub Desktop.
React Functional Component & React Functional Styled Component Snippets
{
"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