Was not able to comment out jsx in react, so I made my own snippets
Saugat Rai

Saugat Rai @raisaugat

About: Been working with frontend stuff and lately more into React

Location:
Kathmandu, Nepal
Joined:
Mar 31, 2019

Was not able to comment out jsx in react, so I made my own snippets

Publish Date: Jul 4 '19
9 0

While I was on a react project, I was not able to comment out jsx which was really frustrating.

The way we comment out jsx is
{/* comment */}

But the default comment function on vscode doesnot comment out jsx. So, I made my own snippets to comment out jsx.

First, open command palette

Search for configure user snippets. But before choosing, look for the language type on your work file.

Then choose javascript or javascriptreact.

After that you will see some examples of how you can make a snippets. Copy below code and paste it.

"Comment out jsx": {
"prefix": "jsx",
"body": [
"{/*",
"${TM_SELECTED_TEXT}",
"*/}"
],
"description": "Comment out jsx"
}

Save the file and you are good to go.

Select the code you want to comment and insert snippets.

Comments 0 total

    Add comment