Last active
November 20, 2022 19:10
-
-
Save squarism/ed8524fdf010533033099dd120813469 to your computer and use it in GitHub Desktop.
React 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
{ | |
// for next, remix and solid index routes that uses the directory name for the component name | |
"export default function": { | |
"prefix": "edf", | |
"body": [ | |
"export default function ${TM_DIRECTORY/^.+\\/(.*)$/${1:/pascalcase}/}() {", | |
"\treturn(", | |
"\t\t${0}", | |
"\t)", | |
"}" | |
], | |
"description": "Export default function component" | |
}, | |
"mantine component": { | |
"prefix": "mc", | |
"body": [ | |
"import { createStyles } from \"@mantine/core\";", | |
"", | |
"const useStyles = createStyles(theme => ({", | |
"\t${2:css}: {", | |
"\t\t// backgroundColor: theme.colors.gray[2],", | |
"\t}", | |
"}));", | |
"", | |
"interface ${1}Props {", | |
"\tname: string;", | |
"}", | |
"", | |
"export const ${1:ComponentName} = ({name}: $1Props) => {", | |
"\tconst { classes } = useStyles();", | |
"", | |
"\treturn (", | |
"\t\t<div className={classes.${2}}>", | |
"\t\t\t${0}", | |
"\t\t</div>", | |
"\t)", | |
"}", | |
], | |
"description": "Mantine component" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JSON comments work fine in vscode