Skip to content

use VSCode's snippet variables for some snippets #20

Closed
@selrond

Description

@selrond

Snippet variables

for example

  "reactFunctionalExportComponent": {
    "prefix": "rfe",
    "body": [
      "import React from 'react'",
      "",
      "const ${1:componentName} = () => {",
      "  return (",
      "    <div>",
      "      $0",
      "    </div>",
      "  )",
      "}",
      "",
      "export default ${1:componentName}",
      ""
    ],
    "description": "Creates a React Functional Component with ES7 module system"
  },

instead of componentName default string, there could be TM_FILENAME_BASE variable, to automatically name the component after the file name.

Saves time, it's more useful, while still stays selected, though easily rewritable.

Win-win.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions