I'm developing in react, but I suppose that this question is applicable to any language mixing javascript and HTML.
I would like to know if there's an easy way of commenting HTML code inside a js file
For example inside the return function I usually have something like:
return (
<View style={styles.container}>
<Text style={styles.text}>Text 1</Text>
<Text style={styles.text}>Text 2</Text>
<Text style={styles.text}>Text 3</Text>
</View>
);
I would be very useful for me to comment Text2
I tried using the HTML comment <!-- -->
but it complains about the ! being an unexpected token.
Failed building JavaScript bundle.
SyntaxError: /home/isaac/Projects/AwesomeProject2/App.js: Unexpected token (20:5
What is the best way of commenting the HTML code inside javascript files?