JSX Comments - 05-26-20

The other day at work we have an html comment in jsx slip on to stage. Made me relize I didn’t know how to leave comments in jsx myself.

So as a reminder DON’T do this:

<div>
    <!-- comment here -->
    <h2>Hello world</h2>
</div>

Instead do this:

<div>
    {/* comment here  */}
    <h2>Hello world</h2>
</div>

source:

https://wesbos.com/react-jsx-comments

\- [ react, jsx ]