How to add a comment to the return statement in the render function?

Are there any features we can add to our comment inside the return statement in the render function. For example, find the code snippet below.

 render: function() {
    var value = this.state.value;
    return (
        <div>                         
            <input type="text" value={value} />
            <select value="B">
                <option value="A">Apple</option>
                <option value="B">Banana</option>
                <option value="C">Cranberry</option>
            </select>
        </div>); 
    ...

In the above code, I want to add a comment next to the tag <input>, for example Read-Only Textbox. Because it does not have onChange Event. How can i add it?

+4
source share
2 answers

You can add comments to render as follows: {/* COMMENT */}

+9
source

Use it as a {/*comment*/} working demo

+1
source

Source: https://habr.com/ru/post/1610916/


All Articles