How to comment on .tsx file?

Viewed 2429

I want to comment TSX code that I showed below. How can I do that?

<Form.Group controlId="type"> <Form.Label>Type</Form.Label>

1 Answers

To add a comment in the middle of JSX, use curly brackets to pop back into plain javascript, then add your comment:

<Form.Group controlId="type">
  {/* Hello World */}
  <Form.Label>Type</Form.Label>
</Form.Group>

Typescript doesn't change this.

Related