Files
freeCodeCamp/guide/english/certifications/front-end-libraries/react/add-comments-in-jsx/index.md
Lipis e84ae45008 Javascript -> JavaScript (English) (#35183)
* Javascript -> JavaScript (English)

* Update technical documentation page for required change

* Update use-class-syntax-to-define-a-constructor-function.english.md

* Update left-factorials.md
2019-03-28 14:05:41 +05:30

526 B

title
title
Add Comments in JSX

Add Comments in JSX

You can comment as you used to do with code blocks in JavaScript /* some JS code */ but they need to wrapped by curly braces to add comments in JSX: For example:

  • Single-line comment:
{/*<h1>Hanoi University of Science</h1>*/}
  • Multi-line comments:
{/*
<h1>Hanoi University of Science</h1>
<p>Falculty of Mathematics, Mechanics and Informatics</p>  
*/}

Notice: You can't use HTML comment in JSX like this:

<!-- not working -->