Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (35 sloc) 730 Bytes
title author layout lang ref permalink path tags
How to comment in React JSX
Marcelo Carmona
post
en
comments-react-jsx
comments-react-jsx
2016-10-06-how-to-comment-in-react-jsx.md
React
Javascript

The way that we can make comments in React is a little weird, and when we search information is difficult to find it. It is not possible to use HTML comments inside of JSX

render() {
  return (
    <div>
      <!-- this does not work -->
    </div>
  )
}

It is necessary to use comments in Javascript but for that we will need to use the curly brackets in the following way:

{/* A JSX comment */}

And multiline

{/* 
    A multiline JSX
    JSX
    comment
*/}