Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 2.03 KB

snippets.md

File metadata and controls

38 lines (30 loc) · 2.03 KB

For vscode snippet docs: what are snippets, create a snippet, syntax

Table of Content:

VSCode doc

For vscode snippet docs: what are snippets, create a snippet, syntax

This adds the following snippets:

"comp"

! Creates a template for a React Functional Component! (TS-> with props, JS-> without)

With the name of the file as the component name!

"hook"

! Simliar to comp, this creates a React hook

With the name of the file! (a hook file should of course be useMyHook, i.e the same name as the hoook)

"useEffect"

! creates a more neat useEffect snippet, without a built-in cleanup

"imp"

! Lets you first write the path from which you want to import, and only afterwards the content you're importing! (that way you should have vscode's intelisense for completion)

"async() anonymous"

Creates the snippet (()=>{$cursor_is_here})(); Note: lately anonymous async functions are (happily) not useful, so you may not understand why.

For more info about each one, go see ./snippets.jsonc!

How to generally add user configured snippets to your vscode

  • press ctrl+shift+p
  • write "configure user snippets"
  • select the relevant option to create a new global snippets file

About my-console.log

It's a console log snippet that is also keybinded to ctrl+shift+c