React · Junior · Question 56 of 75
How do you write a comment inside JSX markup?
- ✓Correct answer:
{/* comment */} - 2
<!-- comment --> - 3
// commenton its own line
Explanation
Inside JSX you are in markup mode, so the comment has to be a JavaScript expression in braces. HTML comments are rendered as text or cause errors.