| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | --- | 
					
						
							|  |  |  | title: Add Comments in JSX | 
					
						
							|  |  |  | --- | 
					
						
							|  |  |  | ## Add Comments in JSX
 | 
					
						
							| 
									
										
										
										
											2019-03-28 09:35:41 +01:00
										 |  |  | 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: | 
					
						
							| 
									
										
										
										
											2018-10-12 15:37:13 -04:00
										 |  |  | For example: | 
					
						
							|  |  |  | * Single-line comment: | 
					
						
							|  |  |  | ```jsx | 
					
						
							|  |  |  | {/*<h1>Hanoi University of Science</h1>*/} | 
					
						
							|  |  |  | ``` | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | * Multi-line comments: | 
					
						
							|  |  |  | ```jsx | 
					
						
							|  |  |  | {/* | 
					
						
							|  |  |  | <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: | 
					
						
							|  |  |  | ```html | 
					
						
							|  |  |  | <!-- not working --> | 
					
						
							|  |  |  | ``` |