Multi-Line Comment If you want to comment something in JSX you need to use JavaScript comments inside of Curly braces like {/*comment here*/}. It is a regular /* Block Comments */ , but need to be wrapped in curly braces.
Multi-Line Comment If you want to comment something in JSX you need to use JavaScript comments inside of Curly braces like {/*comment here*/}. It is a regular /* Block Comments */ , but need to be wrapped in curly braces.
HTML <!--...--> Tag The comment tag is used to insert comments in the source code. Comments are not displayed in the browsers.
class MyClass extends React.Component<any, any> {
render(): JSX.Element {
return (<div>
/*<div>{this.state.myVal} Not Working</div>*/
///<div>{this.state.myVal} Not Working</div>
<!--<div>{this.state.myVal} Not Working</div>-->
</div>);
}
}
I have tried the above 3 ways to comment an entire line. None seem to work. I'm using Visual Studio if it makes a difference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With