Post Link : https://www.skptricks.com/2018/08/how-to-comment-in-react-jsx.html
This tutorial explains how to perform comment in react js application. React uses JSX, it is a XML-like syntax extension to ECMAScript without any defined semantics. It's NOT intended to be implemented by engines or browsers.
Point to remember, while adding comment in react application :
You can use regular /* Block Comments /, but they need to be wrapped in curly braces:
{/ A JSX comment */}For multi-line comment, you can use below syntax :
{/*
Multi
line
comment
*/}-
You can't just use HTML comments inside of JSX because the compiler will think that they are real DOM Nodes. React developers has stated they do not plan to add regular JS commenting to JSX.
Bad Practice.
render() {
return ()
}
Top comments (0)