Skip to content

Instantly share code, notes, and snippets.

@gerwld
Last active March 14, 2025 17:55
Show Gist options
  • Save gerwld/3f03d2d088f169c15c1f4c3b2b4cc44a to your computer and use it in GitHub Desktop.
Save gerwld/3f03d2d088f169c15c1f4c3b2b4cc44a to your computer and use it in GitHub Desktop.
Snippets for Typescript React
// To open and edit javascriptreact.json in VS Code:
// Press Ctrl+Shift+P (or Cmd+Shift+P on Mac) to open the Command Palette.
// Type Preferences: Configure User Snippets and select it.
// Choose javascriptreact.json from the list.
{
"Add Styles Import": {
"prefix": "ims",
"body": ["import style from './style.module.css';"],
"description": "Styles Import"
},
"Add Styles Import 2": {
"prefix": "imss",
"body": ["import s from './s.module.css';"],
"description": "Styles Import"
},
"Add react-icons import": {
"prefix": "imi",
"body": ["import {$1} from 'react-icons/$2';"],
"description": "Import react-icons"
},
"Create Stylesheet.create base": {
"prefix": "stc",
"body": [
"",
"const styles = StyleSheet.create({\nblock: {\n$0\n},\nchild: {\n\n},\nt: {\n\n},\n});",
"",
],
"description": "Adds Stylesheet.create base"
},
"add styles fast": {
"prefix": "st",
"body": [
"className={style.$0}",
],
"description": "Adds Stylesheet.create base"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment