Commenting in JSX

How do you comment things out in JSX ? If you were like me you probably thought  JSX is really just Javascript, so let’s use a Javascript single line comment.

Although some text editors will blur the line the output still comes out

Well lets try a HTML comment and see if that works

Well the JSX compiler doesn’t like that at all. If your guessing a multi-line comment  is what were after that’s almost right, but we must also wrap it in curly braces like so, {/* Example Comment */}. This is the syntax for single and multiline comments in JSX

Take Your React Skills to The Next Level

Here at CodingPhase we offer a comprehensive React Course which will not only cover what you need to know to build projects and be employable. But, will provide you with functional app with great UI/UX to put on your resume. That’s guaranteed to grab hiring managers attention

What’s the price for this? A low $150 when you compare to the $60,000-$90,000 starting salary for React Developers depending on the area

Want to start with a lower upfront fee, but also get access to the Craigslist Clone in React Course

Sign up for a monthly subscription for $20/m