DEV Community

skptricks
skptricks

Posted on • Originally published at skptricks.com on

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.

Top comments (0)