I want to comment TSX code that I showed below. How can I do that?
<Form.Group controlId="type"> <Form.Label>Type</Form.Label>
I want to comment TSX code that I showed below. How can I do that?
<Form.Group controlId="type"> <Form.Label>Type</Form.Label>
There are a few ways.
<Form.Group controlId="type">
{/* Hello World */}
<Form.Label>Type</Form.Label>
</Form.Group>
<Form.Group controlId="type">
{
// Hello World
}
<Form.Label>Type</Form.Label>
</Form.Group>
<Form.Group controlId="type">
{/*
Hello
World
*/}
<Form.Label>Type</Form.Label>
</Form.Group>
<Form.Group /* Hello World */ controlId="type">
<Form.Label>Type</Form.Label>
</Form.Group>
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.
There are a few ways.
<Form.Group controlId="type">
{/* Hello World */}
<Form.Label>Type</Form.Label>
</Form.Group>
<Form.Group controlId="type">
{
// Hello World
}
<Form.Label>Type</Form.Label>
</Form.Group>
<Form.Group controlId="type">
{/*
Hello
World
*/}
<Form.Label>Type</Form.Label>
</Form.Group>
<Form.Group /* Hello World */ controlId="type">
<Form.Label>Type</Form.Label>
</Form.Group>
© 2022 - 2024 — McMap. All rights reserved.