{ "exportType": { "body": ["export type ${1:first} = {${2:second}}"], "key": "exportType", "prefix": "exptp", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "exportInterface": { "key": "exportInterface", "prefix": "expint", "body": ["export interface ${1:first} {${2:second}}"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactClassComponent": { "key": "typescriptReactClassComponent", "prefix": "tsrcc", "description": "Creates a React component class with ES7 module system and TypeScript interfaces", "body": [ "import React, { Component } from 'react'", "", "type Props = {}", "", "type State = {}", "", "export default class ${1:${TM_FILENAME_BASE}} extends Component {", " state = {}", "", " render() {", " return (", "
${1:first}
", " )", " }", "}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactClassExportComponent": { "key": "typescriptReactClassExportComponent", "prefix": "tsrce", "body": [ "import React, { Component } from 'react'", "", "type Props = {}", "", "type State = {}", "", "class ${1:${TM_FILENAME_BASE}} extends Component {", " state = {}", "", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React component class with ES7 module system and TypeScript interfaces", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactFunctionalExportComponent": { "key": "typescriptReactFunctionalExportComponent", "prefix": "tsrfce", "body": [ "import React from 'react'", "", "type Props = {}", "", "function ${1:${TM_FILENAME_BASE}}({}: Props) {", " return (", "
${1:first}
", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactFunctionalComponent": { "key": "typescriptReactFunctionalComponent", "prefix": "tsrfc", "body": [ "import React from 'react'", "", "type Props = {}", "", "export default function ${1:${TM_FILENAME_BASE}}({}: Props) {", " return (", "
${1:first}
", " )", "}" ], "description": "Creates a React Functional Component with ES7 module system and TypeScript interface", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactArrowFunctionExportComponent": { "key": "typescriptReactArrowFunctionExportComponent", "prefix": "tsrafce", "body": [ "import React from 'react'", "", "type Props = {}", "", "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", " return (", "
${1:first}
", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactArrowFunctionComponent": { "key": "typescriptReactArrowFunctionComponent", "prefix": "tsrafc", "body": [ "import React from 'react'", "", "type Props = {}", "", "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", " return (", "
${1:first}
", " )", "}" ], "description": "Creates a React Arrow Function Component with ES7 module system and TypeScript interface", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactClassPureComponent": { "key": "typescriptReactClassPureComponent", "prefix": "tsrpc", "body": [ "import React, { PureComponent } from 'react'", "", "type Props = {}", "", "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", " render() {", " return (", "
${1:first}
", " )", " }", "}" ], "description": "Creates a React pure component class with ES7 module system and TypeScript interface", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactClassExportPureComponent": { "key": "typescriptReactClassExportPureComponent", "prefix": "tsrpce", "body": [ "import React, { PureComponent } from 'react'", "", "type Props = {}", "", "class ${1:${TM_FILENAME_BASE}} extends PureComponent {", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React pure component class with ES7 module system and TypeScript interface", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactClassComponentRedux": { "key": "typescriptReactClassComponentRedux", "prefix": "tsrcredux", "body": [ "import { connect } from 'react-redux'", "import React, { Component } from 'react'", "", "type Props = {}", "", "type State = {}", "", "export class ${1:${TM_FILENAME_BASE}} extends Component {", " state = {}", "", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "const mapStateToProps = (state) => ({})", "", "const mapDispatchToProps = {}", "", "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" ], "description": "Creates a React component class with connected redux and ES7 module system and TypeScript interfaces", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactNativeArrowFunctionComponent": { "key": "typescriptReactNativeArrowFunctionComponent", "prefix": "tsrnf", "body": [ "import { View, Text } from 'react-native'", "import React from 'react'", "", "type Props = {}", "", "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", " return (", " ", " ${1:first}", " ", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Native Arrow Function Component with ES7 module system in TypeScript", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typescriptReactNativeArrowFunctionComponentWithStyles": { "key": "typescriptReactNativeArrowFunctionComponentWithStyles", "prefix": "tsrnfs", "body": [ "import { StyleSheet, Text, View } from 'react-native'", "import React from 'react'", "", "type Props = {}", "", "const ${1:${TM_FILENAME_BASE}} = (props: Props) => {", " return (", " ", " ${1:first}", " ", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}", "", "const styles = StyleSheet.create({})" ], "description": "Creates a React Native Arrow Function Component with ES7 module system, TypeScript interface and StyleSheet", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactArrowFunctionComponent": { "key": "reactArrowFunctionComponent", "prefix": "rafc", "body": [ "import React from 'react'", "", "export const ${1:${TM_FILENAME_BASE}} = () => {", " return (", "
${1:first}
", " )", "}", "" ], "description": "Creates a React Arrow Function Component with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactArrowFunctionComponentWithPropTypes": { "key": "reactArrowFunctionComponentWithPropTypes", "prefix": "rafcp", "body": [ "import React from 'react'", "import PropTypes from 'prop-types'", "", "const ${1:${TM_FILENAME_BASE}} = props => {", " return (", "
${1:first}
", " )", "}", "", "${1:${TM_FILENAME_BASE}}.propTypes = {}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactArrowFunctionExportComponent": { "key": "reactArrowFunctionExportComponent", "prefix": "rafce", "body": [ "import React from 'react'", "", "const ${1:${TM_FILENAME_BASE}} = () => {", " return (", "
${1:first}
", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Arrow Function Component with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponent": { "key": "reactClassComponent", "prefix": "rcc", "body": [ "import React, { Component } from 'react'", "", "export default class ${1:${TM_FILENAME_BASE}} extends Component {", " render() {", " return (", "
${1:first}
", " )", " }", "}", "" ], "description": "Creates a React component class with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponentPropTypes": { "key": "reactClassComponentPropTypes", "prefix": "rccp", "body": [ "import PropTypes from 'prop-types'", "import React, { Component } from 'react'", "", "export default class ${1:${TM_FILENAME_BASE}} extends Component {", " static propTypes = {${2:second}: ${3:third}}", "", " render() {", " return (", "
${1:first}
", " )", " }", "}", "" ], "description": "Creates a React component class with PropTypes and ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponentRedux": { "key": "reactClassComponentRedux", "prefix": "rcredux", "body": [ "import React, { Component } from 'react'", "import { connect } from 'react-redux'", "", "export class ${1:${TM_FILENAME_BASE}} extends Component {", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "const mapStateToProps = (state) => ({})", "", "const mapDispatchToProps = {}", "", "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" ], "description": "Creates a React component class with connected redux and ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassComponentReduxPropTypes": { "key": "reactClassComponentReduxPropTypes", "prefix": "rcreduxp", "body": [ "import PropTypes from 'prop-types'", "import React, { Component } from 'react'", "import { connect } from 'react-redux'", "", "export class ${1:${TM_FILENAME_BASE}} extends Component {", " static propTypes = {", " ${2:second}: ${3:third}", " }", "", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "const mapStateToProps = (state) => ({})", "", "const mapDispatchToProps = {}", "", "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" ], "description": "Creates a React component class with PropTypes with connected redux and ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassExportComponent": { "key": "reactClassExportComponent", "prefix": "rce", "body": [ "import React, { Component } from 'react'", "", "export class ${1:${TM_FILENAME_BASE}} extends Component {", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React component class with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassExportComponentWithPropTypes": { "key": "reactClassExportComponentWithPropTypes", "prefix": "rcep", "body": [ "import PropTypes from 'prop-types'", "import React, { Component } from 'react'", "", "export class ${1:${TM_FILENAME_BASE}} extends Component {", " static propTypes = {}", "", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React component class with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassExportPureComponent": { "key": "reactClassExportPureComponent", "prefix": "rpce", "body": [ "import React, { PureComponent } from 'react'", "", "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", " render() {", " return (", "
${1:first}
", " )", " }", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React pure component class with ES7 module system export", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassPureComponent": { "key": "reactClassPureComponent", "prefix": "rpc", "body": [ "import React, { PureComponent } from 'react'", "", "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", " render() {", " return (", "
${1:first}
", " )", " }", "}", "" ], "description": "Creates a React pure component class with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactClassPureComponentWithPropTypes": { "key": "reactClassPureComponentWithPropTypes", "prefix": "rpcp", "body": [ "import PropTypes from 'prop-types'", "import React, { PureComponent } from 'react'", "", "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", " static propTypes = {}", "", " render() {", " return (", "
${1:first}
", " )", " }", "}", "" ], "description": "Creates a React component class with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionMemoComponent": { "key": "reactFunctionMemoComponent", "prefix": "rmc", "body": [ "import React, { memo } from 'react'", "", "const ${1:${TM_FILENAME_BASE}} = memo(() => {", " return (", "
${1:first}
", " )", "})", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Memo Function Component with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionMemoComponentWithPropTypes": { "key": "reactFunctionMemoComponentWithPropTypes", "prefix": "rmcp", "body": [ "import PropTypes from 'prop-types'", "import React, { memo } from 'react'", "", "const ${1:${TM_FILENAME_BASE}} = memo((props) => {", " return (", "
${1:first}
", " )", "})", "", "${1:${TM_FILENAME_BASE}}.propTypes = {}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Memo Function Component with ES7 module system with PropTypes", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponent": { "key": "reactFunctionalComponent", "prefix": "rfc", "body": [ "import React from 'react'", "", "export default function ${1:${TM_FILENAME_BASE}}() {", " return (", "
${1:first}
", " )", "}", "" ], "description": "Creates a React Functional Component with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponentRedux": { "key": "reactFunctionalComponentRedux", "prefix": "rfcredux", "body": [ "import React from 'react'", "import { connect } from 'react-redux'", "", "export const ${1:${TM_FILENAME_BASE}} = (props) => {", " return (", "
${1:first}
", " )", "}", "", "const mapStateToProps = (state) => ({})", "", "const mapDispatchToProps = {}", "", "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" ], "description": "Creates a React functional component with connected redux and ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponentReduxPropTypes": { "key": "reactFunctionalComponentReduxPropTypes", "prefix": "rfcreduxp", "body": [ "import PropTypes from 'prop-types'", "import React from 'react'", "import { connect } from 'react-redux'", "", "export const ${1:${TM_FILENAME_BASE}} = (props) => {", " return (", "
${1:first}
", " )", "}", "", "${1:${TM_FILENAME_BASE}}.propTypes = {", " ${2:second}: PropTypes.${3:third}", "}", "", "const mapStateToProps = (state) => ({})", "", "const mapDispatchToProps = {}", "", "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})" ], "description": "DEPRECATED: Creates a React functional component with PropTypes with connected redux and ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalComponentWithPropTypes": { "key": "reactFunctionalComponentWithPropTypes", "prefix": "rfcp", "body": [ "import React from 'react'", "import PropTypes from 'prop-types'", "", "function ${1:${TM_FILENAME_BASE}}(props) {", " return (", "
${1:first}
", " )", "}", "", "${1:${TM_FILENAME_BASE}}.propTypes = {}", "", "export default ${1:${TM_FILENAME_BASE}}", "" ], "description": "Creates a React Functional Component with ES7 module system with PropTypes", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactFunctionalExportComponent": { "key": "reactFunctionalExportComponent", "prefix": "rfce", "body": [ "import React from 'react'", "", "function ${1:${TM_FILENAME_BASE}}() {", " return (", "
${1:first}
", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "description": "Creates a React Functional Component with ES7 module system", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleAssert": { "key": "consoleAssert", "prefix": "cas", "body": ["console.assert(${1:first}, ${2:second})"], "description": "If the specified expression is false, the message is written to the console along with a stack trace", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleClear": { "key": "consoleClear", "prefix": "ccl", "body": ["console.clear()"], "description": "Clears the console", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleCount": { "key": "consoleCount", "prefix": "cco", "body": ["console.count(${1:first})"], "description": "Writes the the number of times that count() has been invoked at the same line and with the same label", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleDir": { "key": "consoleDir", "prefix": "cdi", "body": ["console.dir(${1:first})"], "description": "Prints a JavaScript representation of the specified object", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleError": { "key": "consoleError", "prefix": "cer", "body": ["console.error(${1:first})"], "description": "Displays a message in the console and also includes a stack trace from where the method was called", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleGroup": { "key": "consoleGroup", "prefix": "cgr", "body": ["console.group('${1:first}')"], "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleGroupEnd": { "key": "consoleGroupEnd", "prefix": "cge", "body": ["console.groupEnd()"], "description": "Closes out the corresponding console.group().", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleLog": { "key": "consoleLog", "prefix": "clg", "body": ["console.log(${1:first})"], "description": "Displays a message in the console", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleTrace": { "key": "consoleTrace", "prefix": "ctr", "body": ["console.trace(${1:first})"], "description": "Prints a stack trace from the point where the method was called", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleLogObject": { "key": "consoleLogObject", "prefix": "clo", "body": ["console.log('${1:first}', ${1:first})"], "description": "Logs property with name.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleLogJson": { "key": "consoleLogJson", "prefix": "clj", "body": ["console.log('${1:first}', JSON.stringify(${1:first}, null, 2))"], "description": "Logs stringified JSON property with name.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleTime": { "key": "consoleTime", "prefix": "ctm", "body": ["console.time('${1:first}')"], "description": "Console time wrapper", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleTimeEnd": { "key": "consoleTimeEnd", "prefix": "cte", "body": ["console.timeEnd('${1:first}')"], "description": "Console time end wrapper", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleWarn": { "key": "consoleWarn", "prefix": "cwa", "body": ["console.warn(${1:first})"], "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleInfo": { "key": "consoleInfo", "prefix": "cin", "body": ["console.info(${1:first})"], "description": "Displays a message in the console but also displays a blue information icon along with the logged message", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "consoleTable": { "key": "consoleTable", "prefix": "ctl", "body": ["console.table([${1:first}])"], "description": "Logs table to console", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useCallback": { "key": "useCallback", "prefix": "useCallbackSnippet", "body": [ "useCallback(", " () => {", " ${1:first}", " },", " [${2:second}],", ")", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useContext": { "key": "useContext", "prefix": "useContextSnippet", "body": ["const ${1:first} = useContext(${2:second})"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useEffect": { "key": "useEffect", "prefix": "useEffectSnippet", "body": [ "useEffect(() => {", " ${1:first}", "", " return () => {", " ${2:second}", " }", "}, [${3:third}])", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useImperativeHandle": { "key": "useImperativeHandle", "prefix": "useImperativeHandleSnippet", "body": [ "useImperativeHandle(", " ${1:first},", " () => {", " ${2:second}", " },", " [${3:third}],", ")" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useLayoutEffect": { "key": "useLayoutEffect", "prefix": "useLayoutEffectSnippet", "body": [ "useLayoutEffect(() => {", " ${1:first}", "", " return () => {", " ${2:second}", " };", "}, [${3:third}])" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useMemo": { "key": "useMemo", "prefix": "useMemoSnippet", "body": ["useMemo(() => ${1:first}, [${2:second}])"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useReducer": { "key": "useReducer", "prefix": "useReducerSnippet", "body": [ "const [state, dispatch] = useReducer(${1:first}, ${2:second}, ${3:third})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useRef": { "key": "useRef", "prefix": "useRefSnippet", "body": ["const ${1:first} = useRef(${2:second})"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "useState": { "key": "useState", "prefix": "useStateSnippet", "body": [ "const [${1:first}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:second})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importAs": { "key": "importAs", "prefix": "ima", "body": ["import { ${2:second} as ${3:third} } from '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importBrowserRouter": { "key": "importBrowserRouter", "prefix": "imbr", "body": ["import { BrowserRouter as Router } from 'react-router-dom'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importBrowserRouterWithRouteAndNavLink": { "key": "importBrowserRouterWithRouteAndNavLink", "prefix": "imrr", "body": [ "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importDestructing": { "key": "importDestructing", "prefix": "imd", "body": ["import { ${2:second} } from '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importEverything": { "key": "importEverything", "prefix": "ime", "body": ["import * as ${2:second} from '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importNoModuleName": { "key": "importNoModuleName", "prefix": "imn", "body": ["import '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importPropTypes": { "key": "importPropTypes", "prefix": "impt", "body": ["import PropTypes from 'prop-types'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReact": { "key": "importReact", "prefix": "imr", "body": ["import React from 'react'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactDom": { "key": "importReactDom", "prefix": "imrd", "body": ["import ReactDOM from 'react-dom'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithComponent": { "key": "importReactWithComponent", "prefix": "imrc", "body": ["import React, { Component } from 'react'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithComponentAndPropTypes": { "key": "importReactWithComponentAndPropTypes", "prefix": "imrcp", "body": [ "import React, { Component } from 'react'", "import PropTypes from 'prop-types'", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithMemo": { "key": "importReactWithMemo", "prefix": "imrm", "body": ["import React, { memo } from 'react'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithMemoAndPropTypes": { "key": "importReactWithMemoAndPropTypes", "prefix": "imrmp", "body": [ "import React, { memo } from 'react'", "import PropTypes from 'prop-types'", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithPureComponent": { "key": "importReactWithPureComponent", "prefix": "imrpc", "body": ["import React, { PureComponent } from 'react'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReactWithPureComponentAndPropTypes": { "key": "importReactWithPureComponentAndPropTypes", "prefix": "imrpcp", "body": [ "import React, { PureComponent } from 'react'", "import PropTypes from 'prop-types'", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterLink": { "key": "importRouterLink", "prefix": "imbrl", "body": ["import { Link } from 'react-router-dom'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterNavLink": { "key": "importRouterNavLink", "prefix": "imbrnl", "body": ["import { NavLink } from 'react-router-dom'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterSetup": { "key": "importRouterSetup", "prefix": "imbrc", "body": ["import { Route, Switch, NavLink, Link } from 'react-router-dom'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importRouterSwitch": { "key": "importRouterSwitch", "prefix": "imbrs", "body": ["import { Switch } from 'react-router-dom'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "import": { "key": "import", "prefix": "imp", "body": ["import ${2:second} from '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArray": { "key": "propTypeArray", "prefix": "pta", "body": ["PropTypes.array"], "description": "Array prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArrayRequired": { "key": "propTypeArrayRequired", "prefix": "ptar", "body": ["PropTypes.array.isRequired"], "description": "Array prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeBool": { "key": "propTypeBool", "prefix": "ptb", "body": ["PropTypes.bool"], "description": "Bool prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeBoolRequired": { "key": "propTypeBoolRequired", "prefix": "ptbr", "body": ["PropTypes.bool.isRequired"], "description": "Bool prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeFunc": { "key": "propTypeFunc", "prefix": "ptf", "body": ["PropTypes.func"], "description": "Func prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeFuncRequired": { "key": "propTypeFuncRequired", "prefix": "ptfr", "body": ["PropTypes.func.isRequired"], "description": "Func prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNumber": { "key": "propTypeNumber", "prefix": "ptn", "body": ["PropTypes.number"], "description": "Number prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNumberRequired": { "key": "propTypeNumberRequired", "prefix": "ptnr", "body": ["PropTypes.number.isRequired"], "description": "Number prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObject": { "key": "propTypeObject", "prefix": "pto", "body": ["PropTypes.object"], "description": "Object prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObjectRequired": { "key": "propTypeObjectRequired", "prefix": "ptor", "body": ["PropTypes.object.isRequired"], "description": "Object prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeString": { "key": "propTypeString", "prefix": "pts", "body": ["PropTypes.string"], "description": "String prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeStringRequired": { "key": "propTypeStringRequired", "prefix": "ptsr", "body": ["PropTypes.string.isRequired"], "description": "String prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNode": { "key": "propTypeNode", "prefix": "ptnd", "body": ["PropTypes.node"], "description": "Anything that can be rendered: numbers, strings, elements or an array", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeNodeRequired": { "key": "propTypeNodeRequired", "prefix": "ptndr", "body": ["PropTypes.node.isRequired"], "description": "Anything that can be rendered: numbers, strings, elements or an array required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeElement": { "key": "propTypeElement", "prefix": "ptel", "body": ["PropTypes.element"], "description": "React element prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeElementRequired": { "key": "propTypeElementRequired", "prefix": "ptelr", "body": ["PropTypes.element.isRequired"], "description": "React element prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeInstanceOf": { "key": "propTypeInstanceOf", "prefix": "pti", "body": ["PropTypes.instanceOf($0)"], "description": "Is an instance of a class prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeInstanceOfRequired": { "key": "propTypeInstanceOfRequired", "prefix": "ptir", "body": ["PropTypes.instanceOf($0).isRequired"], "description": "Is an instance of a class prop type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeEnum": { "key": "propTypeEnum", "prefix": "pte", "body": ["PropTypes.oneOf(['$0'])"], "description": "Prop type limited to specific values by treating it as an enum", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeEnumRequired": { "key": "propTypeEnumRequired", "prefix": "pter", "body": ["PropTypes.oneOf(['$0']).isRequired"], "description": "Prop type limited to specific values by treating it as an enum required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeOneOfType": { "key": "propTypeOneOfType", "prefix": "ptet", "body": ["PropTypes.oneOfType([", " $0", "])"], "description": "An object that could be one of many types", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeOneOfTypeRequired": { "key": "propTypeOneOfTypeRequired", "prefix": "ptetr", "body": ["PropTypes.oneOfType([", " $0", "]).isRequired"], "description": "An object that could be one of many types required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArrayOf": { "key": "propTypeArrayOf", "prefix": "ptao", "body": ["PropTypes.arrayOf($0)"], "description": "An array of a certain type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeArrayOfRequired": { "key": "propTypeArrayOfRequired", "prefix": "ptaor", "body": ["PropTypes.arrayOf($0).isRequired"], "description": "An array of a certain type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObjectOf": { "key": "propTypeObjectOf", "prefix": "ptoo", "body": ["PropTypes.objectOf($0)"], "description": "An object with property values of a certain type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeObjectOfRequired": { "key": "propTypeObjectOfRequired", "prefix": "ptoor", "body": ["PropTypes.objectOf($0).isRequired"], "description": "An object with property values of a certain type required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeShape": { "key": "propTypeShape", "prefix": "ptsh", "body": ["PropTypes.shape({", " $0", "})"], "description": "An object taking on a particular shape", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeShapeRequired": { "key": "propTypeShapeRequired", "prefix": "ptshr", "body": ["PropTypes.shape({", " $0", "}).isRequired"], "description": "An object taking on a particular shape required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeExact": { "key": "propTypeExact", "prefix": "ptex", "body": ["PropTypes.exact({", " $0", "})"], "description": "An object with warnings on extra properties", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeExactRequired": { "key": "propTypeExactRequired", "prefix": "ptexr", "body": ["PropTypes.exact({", " $0", "}).isRequired"], "description": "An object with warnings on extra properties required", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propTypeAny": { "key": "propTypeAny", "prefix": "ptany", "body": ["PropTypes.any"], "description": "Any prop type", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeComponent": { "key": "reactNativeComponent", "prefix": "rnc", "body": [ "import { Text, View } from 'react-native'", "import React, { Component } from 'react'", "", "export default class ${1:${TM_FILENAME_BASE}} extends Component {", " render() {", " return (", " ", " ${1:first}", " ", " )", " }", "}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeComponentExport": { "key": "reactNativeComponentExport", "prefix": "rnce", "body": [ "import { Text, View } from 'react-native'", "import React, { Component } from 'react'", "", "export class ${1:${TM_FILENAME_BASE}} extends Component {", " render() {", " return (", " ", " ${1:first}", " ", " )", " }", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeComponentWithStyles": { "key": "reactNativeComponentWithStyles", "prefix": "rncs", "body": [ "import { Text, StyleSheet, View } from 'react-native'", "import React, { Component } from 'react'", "", "export default class ${1:${TM_FILENAME_BASE}} extends Component {", " render() {", " return (", " ", " ${1:first}", " ", " )", " }", "}", "", "const styles = StyleSheet.create({})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalComponent": { "key": "reactNativeFunctionalComponent", "prefix": "rnf", "body": [ "import { View, Text } from 'react-native'", "import React from 'react'", "", "export default function ${1:${TM_FILENAME_BASE}}() {", " return (", " ", " ${1:first}", " ", " )", "}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalComponentWithStyles": { "key": "reactNativeFunctionalComponentWithStyles", "prefix": "rnfs", "body": [ "import { StyleSheet, Text, View } from 'react-native'", "import React from 'react'", "", "export default function ${1:${TM_FILENAME_BASE}}() {", " return (", " ", " ${1:first}", " ", " )", "}", "", "const styles = StyleSheet.create({})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalExportComponent": { "key": "reactNativeFunctionalExportComponent", "prefix": "rnfe", "body": [ "import { View, Text } from 'react-native'", "import React from 'react'", "", "const ${1:${TM_FILENAME_BASE}} = () => {", " return (", " ", " ${1:first}", " ", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeFunctionalExportComponentWithStyles": { "key": "reactNativeFunctionalExportComponentWithStyles", "prefix": "rnfes", "body": [ "import { StyleSheet, Text, View } from 'react-native'", "import React from 'react'", "", "const ${1:${TM_FILENAME_BASE}} = () => {", " return (", " ", " ${1:first}", " ", " )", "}", "", "export default ${1:${TM_FILENAME_BASE}}", "", "const styles = StyleSheet.create({})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeImport": { "key": "reactNativeImport", "prefix": "imrn", "body": ["import { ${1:first} } from 'react-native'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativePureComponent": { "key": "reactNativePureComponent", "prefix": "rnpc", "body": [ "import { Text, View } from 'react-native'", "import React, { PureComponent } from 'react'", "", "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {", " render() {", " return (", " ", " ${1:first}", " ", " )", " }", "}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativePureComponentExport": { "key": "reactNativePureComponentExport", "prefix": "rnpce", "body": [ "import { Text, View } from 'react-native'", "import React, { PureComponent } from 'react'", "", "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {", " render() {", " return (", " ", " ${1:first}", " ", " )", " }", "}", "", "export default ${1:${TM_FILENAME_BASE}}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reactNativeStyles": { "key": "reactNativeStyles", "prefix": "rnstyle", "body": ["const styles = StyleSheet.create({${1:first}})"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "importReduxConnect": { "key": "importReduxConnect", "prefix": "redux", "body": ["import { connect } from 'react-redux'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxAction": { "key": "reduxAction", "prefix": "rxaction", "body": [ "export const ${1:first} = (payload) => ({", " type: ${2:second},", " payload", "})", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxConst": { "key": "reduxConst", "prefix": "rxconst", "body": ["export const ${1:first} = '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxReducer": { "key": "reduxReducer", "prefix": "rxreducer", "body": [ "const initialState = {}", "", "export default (state = initialState, { type, payload }) => {", " switch (type) {", "", " case ${1:first}:", " return { ...state, ...payload }", "", " default:", " return state", " }", "}", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxSelector": { "key": "reduxSelector", "prefix": "rxselect", "body": [ "import { createSelector } from 'reselect'", "", "export const ${1:first} = state => state.${2:second}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "reduxSlice": { "key": "reduxSlice", "prefix": "rxslice", "body": [ "import { createSlice } from '@reduxjs/toolkit'", "", "const initialState = {", "", "}", "", "const ${1:${TM_FILENAME_BASE}} = createSlice({", " name: ${2:second},", " initialState,", " reducers: {}", "});", "", "export const {} = ${1:${TM_FILENAME_BASE}}.actions", "", "export default ${1:${TM_FILENAME_BASE}}.reducer" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "mappingToProps": { "key": "mappingToProps", "prefix": "reduxmap", "body": [ "const mapStateToProps = (state) => ({})", "", "const mapDispatchToProps = {}" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "describeBlock": { "key": "describeBlock", "prefix": "desc", "body": ["describe('${1:first}', () => { ${2:second} })"], "description": "Testing `describe` block", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "itAsyncBlock": { "key": "itAsyncBlock", "prefix": "tita", "body": ["it('should ${1:first}', async () => { ${2:second} })"], "description": "Testing asynchronous `it` block", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "itBlock": { "key": "itBlock", "prefix": "tit", "body": ["it('should ${1:first}', () => { ${2:second} })"], "description": "Testing `it` block", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactComponentTestWithRedux": { "key": "setupReactComponentTestWithRedux", "prefix": "srtest", "body": [ "import React from 'react'", "import renderer from 'react-test-renderer'", "import { Provider } from 'react-redux'", "", "import store from '~/store'", "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", "", "describe('<${1:${TM_FILENAME_BASE}} />', () => {", " const defaultProps = {}", " const wrapper = renderer.create(", " ", " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", " ,", " )", "", " test('render', () => {", " expect(wrapper).toMatchSnapshot()", " })", "})" ], "description": "Create test component", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactNativeTest": { "key": "setupReactNativeTest", "prefix": "sntest", "body": [ "import 'react-native'", "import React from 'react'", "import renderer from 'react-test-renderer'", "", "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", "", "describe('<${1:${TM_FILENAME_BASE}} />', () => {", " const defaultProps = {}", " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", "", " test('render', () => {", " expect(wrapper).toMatchSnapshot()", " })", "})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactNativeTestWithRedux": { "key": "setupReactNativeTestWithRedux", "prefix": "snrtest", "body": [ "import 'react-native'", "import React from 'react'", "import renderer from 'react-test-renderer'", "import { Provider } from 'react-redux'", "", "import store from '~/store'", "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'", "", "describe('<${1:${TM_FILENAME_BASE}} />', () => {", " const defaultProps = {}", " const wrapper = renderer.create(", " ", " <${1:${TM_FILENAME_BASE}} {...defaultProps} />", " ,", " )", "", " test('render', () => {", " expect(wrapper).toMatchSnapshot()", " })", "})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setupReactTest": { "key": "setupReactTest", "prefix": "stest", "body": [ "import React from 'react'", "import renderer from 'react-test-renderer'", "", "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'", "", "describe('<${1:${TM_FILENAME_BASE}} />', () => {", " const defaultProps = {}", " const wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)", "", " test('render', () => {", " expect(wrapper).toMatchSnapshot()", " })", "})" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "testAsyncBlock": { "key": "testAsyncBlock", "prefix": "testa", "body": ["test('should ${1:first}', async () => { ${2:second} })"], "description": "Testing `asynchronous test` block", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "testBlock": { "key": "testBlock", "prefix": "test", "body": ["test('should ${1:first}', () => { ${2:second} })"], "description": "Testing `test` block", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "exportDefault": { "key": "exportDefault", "prefix": "exp", "body": ["export default ${1:first}"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "exportDestructing": { "key": "exportDestructing", "prefix": "exd", "body": ["export { ${2:second} } from '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "exportAs": { "key": "exportAs", "prefix": "exa", "body": ["export { ${2:second} as ${3:third} } from '${1:first}'"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "exportNamedFunction": { "key": "exportNamedFunction", "prefix": "enf", "body": ["export const ${1:first} = (${2:second}) => {${3:third}}"], "description": "Export named function", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "exportDefaultFunction": { "key": "exportDefaultFunction", "prefix": "edf", "body": ["export default (${1:first}) => {${2:second}}"], "description": "Export default function", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "exportDefaultNamedFunction": { "key": "exportDefaultNamedFunction", "prefix": "ednf", "body": ["export default function ${1:first}(${2:second}) {${3:third}}"], "description": "Export default named function", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "method": { "key": "method", "prefix": "met", "body": ["${1:first} = (${2:second}) => {${3:third}}"], "description": "Creates a method inside a class", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propertyGet": { "key": "propertyGet", "prefix": "pge", "body": ["get ${1:first}() {", " return this.${2:second}", "}"], "description": "Creates a getter property inside a class", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "propertySet": { "key": "propertySet", "prefix": "pse", "body": ["set ${1:first}(${2:second}) {${3:third}}"], "description": "Creates a setter property inside a class", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "forEach": { "key": "forEach", "prefix": "fre", "body": ["${1:first}.forEach(${2:second} => {${3:third}})"], "description": "Creates a forEach statement", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "forOf": { "key": "forOf", "prefix": "fof", "body": ["for(let ${1:first} of ${2:second}) {${3:third}}"], "description": "Iterating over property names of iterable objects", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "forIn": { "key": "forIn", "prefix": "fin", "body": ["for(let ${1:first} in ${2:second}) {${3:third}}"], "description": "Iterating over property values of iterable objects", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "anonymousFunction": { "key": "anonymousFunction", "prefix": "anfn", "body": ["(${1:first}) => { ${2:second} }"], "description": "Creates an anonymous function", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "namedFunction": { "key": "namedFunction", "prefix": "nfn", "body": ["const ${1:first} = (${2:second}) => { ${3:third} }"], "description": "Creates a named function", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "destructingObject": { "key": "destructingObject", "prefix": "dob", "body": ["const {${2:second}} = ${1:first}"], "description": "Creates and assigns a local variable using object destructing", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "destructingArray": { "key": "destructingArray", "prefix": "dar", "body": ["const [${2:second}] = ${1:first}"], "description": "Creates and assigns a local variable using array destructing", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setInterval": { "key": "setInterval", "prefix": "sti", "body": ["setInterval(() => { ${1:first} }, ${2:second})"], "description": "Executes the given function at specified intervals", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "setTimeOut": { "key": "setTimeOut", "prefix": "sto", "body": ["setTimeout(() => { ${1:first} }, ${2:second})"], "description": "Executes the given function after the specified delay", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "promise": { "key": "promise", "prefix": "prom", "body": ["return new Promise((resolve, reject) => { ${1:first} })"], "description": "Creates and returns a new Promise in the standard ES7 syntax", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "destructProps": { "key": "destructProps", "prefix": "cp", "body": ["const { ${1:first} } = this.props"], "description": "Creates and assigns a local variable using props destructing", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "destructState": { "key": "destructState", "prefix": "cs", "body": ["const { ${1:first} } = this.state"], "description": "Creates and assigns a local variable using state destructing", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "classConstructor": { "key": "classConstructor", "prefix": "rconst", "body": [ "constructor(props) {", " super(props)", "", " this.state = {", " ${1:first}", " }", "}" ], "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "emptyState": { "key": "emptyState", "prefix": "est", "body": ["state = { ${1:first} }"], "description": "Creates empty state object. To be used in a constructor.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "componentDidMount": { "key": "componentDidMount", "prefix": "cdm", "body": ["componentDidMount() { ${1:first} }"], "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "shouldComponentUpdate": { "key": "shouldComponentUpdate", "prefix": "scu", "body": ["shouldComponentUpdate(nextProps, nextState) { ${1:first} }"], "description": "Invoked before rendering when new props or state are being received. ", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "componentDidUpdate": { "key": "componentDidUpdate", "prefix": "cdup", "body": ["componentDidUpdate(prevProps, prevState) { ${1:first}} "], "description": "Invoked immediately after the component's updates are flushed to the DOM.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "componentWillUnmount": { "key": "componentWillUnmount", "prefix": "cwun", "body": ["componentWillUnmount() {${1:first} }"], "description": "Invoked immediately before a component is unmounted from the DOM.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "getDerivedStateFromProps": { "key": "getDerivedStateFromProps", "prefix": "gdsfp", "body": ["static getDerivedStateFromProps(props, state) {${1:first}}"], "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates.", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "getSnapshotBeforeUpdate": { "key": "getSnapshotBeforeUpdate", "prefix": "gsbu", "body": [ "getSnapshotBeforeUpdate = (prevProps, prevState) => {${1:first}}" ], "description": "Called right before mutations are made (e.g. before the DOM is updated)", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "createContext": { "key": "createContext", "prefix": "rcontext", "body": ["const ${1:first} = React.createContext()"], "description": "Create React context", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "createRef": { "key": "createRef", "prefix": "cref", "body": ["this.${1:first}Ref = React.createRef()"], "description": "Create ref statement used inside constructor", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "componentSetStateObject": { "key": "componentSetStateObject", "prefix": "sst", "body": ["this.setState({${1:first}})"], "description": "Performs a shallow merge of nextState into current state", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "componentSetStateFunc": { "key": "componentSetStateFunc", "prefix": "ssf", "body": ["this.setState((state, props) => { return { ${1:first} }})"], "description": "Performs a shallow merge of nextState into current state", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "componentProps": { "key": "componentProps", "prefix": "props", "body": ["this.props.${1:first}"], "description": "Access component's props", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "componentState": { "key": "componentState", "prefix": "state", "body": ["this.state.${1:first}"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "bindThis": { "key": "bindThis", "prefix": "bnd", "body": ["this.${1:first} = this.${1:first}.bind(this)"], "description": "Binds this to a method", "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "commentBigBlock": { "key": "commentBigBlock", "prefix": "cmmb", "body": ["/**", " * ${1:first}", " */"], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "hocComponentWithRedux": { "key": "hocComponentWithRedux", "prefix": "hocredux", "body": [ "import React from 'react'", "import { connect } from 'react-redux'", "import PropTypes from 'prop-types'", "", "export const mapStateToProps = state => ({})", "", "export const mapDispatchToProps = {}", "", "export const ${1:first} = (WrappedComponent) => {", " const hocComponent = ({ ...props }) => ", "", " hocComponent.propTypes = {}", "", " return hocComponent", "}", "", "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:first}(WrapperComponent))", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "hocComponent": { "key": "hocComponent", "prefix": "hoc", "body": [ "import React from 'react'", "import PropTypes from 'prop-types'", "", "export default (WrappedComponent) => {", " const hocComponent = ({ ...props }) => ", "", " hocComponent.propTypes = {}", "", " return hocComponent", "}", "" ], "scope": "typescript,typescriptreact,javascript,javascriptreact" }, "typeofSnippet": { "key": "typeofSnippet", "prefix": "tpf", "body": ["typeof ${1:first}"], "scope": "typescript,typescriptreact,javascript,javascriptreact" } }