Add Single Line And Multiple Line Comments Syntax in React Native JSX

React native support comments, which is used to stop executing any line of code at compiling time in both Android and iOS react native applications. There are 2 types of comment syntax react native supports.

Comments

1. //  ( Double Forward Slash ) : – Double Forward Slash is used to comment only single line in react native code.

2. { /* Your Code */}  :- The second format is used to comment JSX code present inside render’s return box. You need to cover the your code into curly bracts then forward slash then star ( {/* ) now goto end of your code which you want to comment and put Star then forward Slash then Curly brackets ( */} ).

 

2 Comments

  1. Riva Ananta Baskara

    Hi, what kind of version your react-native?

Leave a Reply

Your email address will not be published.