Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React: how to comment HTML inside a render method

Tags:

reactjs

(Sorry if too obvious and/or dup, couldn't find original one...)

How should I be able to comment out TodoTitle below? I tried with <!--...-->, //, /*...*/ with no luck.

class TodoApp extends React.Component {
  render() {
    return (
      <div className="todo-app">
        <TodoTitle />
      </div>
    );
  }
}
like image 747
Ariel Avatar asked Dec 06 '25 03:12

Ariel


1 Answers

You can comment {/* comment */} in JSX.

like image 84
Kalaikumar Thangasamy Avatar answered Dec 07 '25 19:12

Kalaikumar Thangasamy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!