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

Y.H. Eng picture Y.H. Eng · Jul 20, 2016 · Viewed 35.9k times · Source

Unlike in webstorm, I'm unable to comment JSX code out in .js files in the Visual Studio Code.

Answer

erichardson30 picture erichardson30 · Jul 20, 2016

You can comment out JSX by {/**/}

Example :

render() {
  return (
    <div>
      <Component1 />
      {/* <Component2 /> */}
    </div>
  )
}

and then Component2 would be commented out