How to comment JSX code out in .js files in VSCode? How to comment JSX code out in .js files in VSCode? reactjs reactjs

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


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.