bonham000 / fcc-react-tests-module

The original freeCodeCamp React/Redux alpha curriculum.
http://hysterical-amusement.surge.sh/
BSD 3-Clause "New" or "Revised" License
77 stars 38 forks source link

Issue on "Challenge: Add Comments in JSX" #206

Closed ShadowKnight00 closed 7 years ago

ShadowKnight00 commented 7 years ago

This might be too minor to report. If so, I apologize. This is my first time reporting an issue, so if I'm violating some etiquette rule, please let me know.

On this challenge you're supposed to add a JSX comment. If you add the comment near the top of the JSX variable, the test fails. If you add it near the end, it succeeds. I think it's because the test is looking for the first element to be the div, but I didn't think the comment would count as an element. (I originally added the comment on line 2, above the div tag, and it failed the test. Moving the comment to line 5 passed)

bonham000 commented 7 years ago

JSX can only return a single element, if you add a comment outside of this element, it's no longer JSX it's just JS. But then, the syntax for the JSX comment is invalid. Try writing a normal comment outside the div and a JSX comment anywhere inside the div and it will succeed.

ShadowKnight00 commented 7 years ago

Thanks for the clarification!