Skip to content

Instantly share code, notes, and snippets.

@vdanchenkov
Last active February 6, 2022 15:09
Show Gist options
  • Save vdanchenkov/a45a1894661555eb58e4dd5db46b869c to your computer and use it in GitHub Desktop.
Save vdanchenkov/a45a1894661555eb58e4dd5db46b869c to your computer and use it in GitHub Desktop.
My vscode snippets for rescript, recoil
{
"className": {
"prefix": ["cn", "tw"],
"body": "className=\"$0\""
},
"className conditional": {
"prefix": "cnn",
"body": "className={cx([\"$0\"])}"
},
"React Component": {
"prefix": "rc",
"body": ["@react.component", "let make = () => $0"]
},
"Module React Component": {
"prefix": "mrc",
"body": [
"module $0 = {",
" @react.component",
" let make = () => <TODO/>",
"}"
]
},
"React.string": {
"prefix": "rs",
"body": "{\"$0\"->React.string}"
},
"React.array": {
"prefix": "ra",
"body": "React.array"
},
"React.null": {
"prefix": "rn",
"body": "React.null"
},
"React.useEffect": {
"prefix": "rue",
"body": ["React.useEffect$1(() => {", " $0", "});"]
},
"Recoil.useRecoilValue": {
"prefix": "urv",
"body": ["let ${1:state} = Recoil.useRecoilValue($2)$0"]
},
"Recoil.useRecoilState": {
"prefix": "urs",
"body": [
"let (${1:state}, set${1/(.*)/${1:/capitalize}/}) = Recoil.useRecoilValue($2)$0"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment