DEV Community

skptricks
skptricks

Posted on • Originally published at skptricks.com on

2 2

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


source : Add Single Line And Multiple Line Comments Syntax In React Native JSX

This tutorial explains how to add single and multi-line comments in react native application. As you already know that comment line provides information to user about the existing code line and their functionalities. There are 2 types of comment syntax in react native application.

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

Importance of comment line in programming language :

  1. Well its a sign of a good programmer to use comments in your program.
  2. Since it enhances the comprehensibility of the program i.e. if someone else walks through your lines of code then its easy for him/her to understand its working and functionality.
  3. It makes maintenance and modification of code easier without creating new bugs/errors.

*Single line comment in react native : *

export default class App extends Component {  

  constructor() {  
super();  
//this.state = { TextInputDisableStatus: true }  
}  

---------------  
---------------  
---------------  
}

*Multi-line Comment in react native : *

------------------------  
-----------------------  
------------------------  

 render() {  
return (  
<View style={styles.container}>  

<TextInput  
          placeholder="Enter Your Userame"  
          underlineColorAndroid='transparent'  
          style={[styles.TextInputStyle, { backgroundColor: this.state.TextInputDisableStatus ? '#FFF' : '#C0C0C0' }]}  
          editable={this.state.TextInputDisableHolder}  
/>  
{  
/\*  
          updated by : skptricks  
          updated on : 12 jan 2019  
          Description : This button helps to disable the textfield when user click on it...  
          \*/  
}  

<Button  
          onPress={this.onPressButton}  
          title="Update Username"  
          color="#841584"  
          accessibilityLabel="Update Username"  
/>  

</View>  
);  
}

This is all about Single Line And Multiple Line Comments Syntax in React Native. Thank you for reading this article, and if you have any problem, have a another better useful solution about this article, please write message in the comment section.

Heroku

Amplify your impact where it matters most — building exceptional apps.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

👋 Kindness is contagious

Please show some love ❤️ or share a kind word in the comments if you found this useful!

Got it!