Skip to content

Instantly share code, notes, and snippets.

@CarlaKremer
Last active September 1, 2022 17:23
Show Gist options
  • Save CarlaKremer/d04522ca0bcd8e5803f731014f8e9677 to your computer and use it in GitHub Desktop.
Save CarlaKremer/d04522ca0bcd8e5803f731014f8e9677 to your computer and use it in GitHub Desktop.
Backup for React Native snippets I use
{
"Basic React Native Interface": {
"prefix": "rnfc",
"body": [
"import React from 'react'",
"",
"import {",
" Container",
"} from './styles';",
"",
"export function ${1:${TM_DIRECTORY/^.*(\\/|\\\\)([^(\\/|\\\\)]+)$/$2/}}() {",
"return (",
" <Container>",
"",
" </Container>",
");",
"}",
]
},
"Basic React Native Interface const": {
"prefix": "rnc",
"body": [
"import React from 'react'",
"",
"import {",
" Container",
"} from './styles';",
"",
"const ${1:${TM_DIRECTORY/^.*(\\/|\\\\)([^(\\/|\\\\)]+)$/$2/}} = () => {",
"return (",
" <Container>",
"",
" </Container>",
");",
"}",
"export default ${1:${TM_DIRECTORY/^.*(\\/|\\\\)([^(\\/|\\\\)]+)$/$2/}};"
]
},
"Basic React Native Interface Index": {
"prefix": "rni",
"body": [
"import React from 'react'",
"",
"import {",
" Container",
"} from './styles';",
"",
"const Index: React.FC = () => {",
"return (",
" <Container>",
"",
" </Container>",
");",
"}",
"export default Index;"
]
},
"Basic React Native Styled Components": {
"prefix": "rnsc",
"body": [
"import styled from 'styled-components/native';",
"",
"export const Container = styled.View`",
" flex: 1;",
"`;"
]
},
"Use Effect" : {
"prefix": "uef",
"body": [
"useEffect(() => {",
" ",
"},[]);"
]
},
"Tron" : {
"prefix": "tron",
"body": [
"console.tron.log($0);"
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment