- ReactJS is a JS library used for building user interfaces.
- It is Declarative, Component-based and Technology stack agnostic.
- It is only designed for speed, simplicity, and scalability.
- It is some of the most popular libraries among web developers.
For example(1),
Comments for React Components:
- We can write comments in React using the double forward-slash // or the asterisk format /* */, similar to regular JavaScript.
Output :
For example(2),
In example(1) does not work when we want to comment on things inside the render block. we use JSX inside the render block and must use the multi-line comments in curly braces {/* */} .
Output:
For example(3),
We must remember, that even though JSX gets rendered just like normal HTML. It is actually a syntax extension to JavaScript. So, using <!– –> as we did with HTML and XML will not work.
Output: