How to comment JSX code out in .js files in VSCode?
You can comment out JSX by {/**/}
Example :
render() { return ( <div> <Component1 /> {/* <Component2 /> */} </div> )}
and then Component2 would be commented out
Search Babel JavaScript
in VS Code:
https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel
Install and command + /
will comment jsx with { /* */ }
Try to disable all plugins, because they can change editor's behaviour. For example if use Babel ES6/ES7 plugin, editor comments .jsx
syntax by //
instead of {/*
. You see see the issue here.