The snippets of react native (virtual studio code)
- Copy Snippets File
copy javascriptreact.json to to the following directory: /Users/xxxxxx/Library/Application Support/Code/User/snippets
- Edit Snippets
Code -> Preferences -> User Snippets -> JavaScript
Place your snippets for Javascript here. Each snippet is defined under a snippet name and has a prefix, body and description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:$1, $2 for tab stops,
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
}
"constructor": {
"prefix": "cst",
"body": [
"constructor(props: Object) {",
" super(props)",
"",
" $1",
"}"
]
},
"navigation ": {
"prefix": "navopt",
"body": [
"static navigationOptions = ({ navigation }) => ({",
" title: '${1:title}',",
"})"
]
},