
The lines of code read as follows. Line 1. class Box extends React dot Component open curly brace at indentation level 0. Note: State is available within class components. Line 2: constructor open parenthesis props close parenthesis open curly brace at indentation level 1. Note: State is usually initialized in the class constructor. Line 3: super open parenthesis props close parenthesis semicolon at indentation level 2. Line 4: this dot state equals open curly brace currentSeconds colon props dot start close curly brace semicolon at indentation level 2. Note: The this keyword in line 4 indicates that the state belongs to the component it is defined in. currentSeconds colon props dot start indicates that the state data can be any number of property colon value pairs. Line 5. setInterval open parenthesis open parenthesis close parenthesis arrow function open curly brace at indentation level 2. Line 6: StartCommand let EndCommand newSecs equals this dot state dot currentSeconds plus 1 semicolon at indentation level 3. Line 7: this dot setState open parenthesis open curly brace currentSeconds colon newSecs close curly brace close parenthesis semicolon at indentation level 3. Note: this dot setState in line 7 indicates that the state is modified by setState open parenthesis close parenthesis function. Line 8: close curly brace comma 1000 close parenthesis semicolon at indentation level 2. Line 9: close curly brace at indentation level 1. Line 10: render open parenthesis close parenthesis open curly brace at indentation level 1. Line 11: return open parenthesis at indentation level 2. Line 12: open angle bracket div className equals open double quotes box close double quotes close angle bracket at indentation level 3. Line 13: open curly brace this dot state dot currentSeconds close curly brace secs at indentation level 4. Note: this dot state in line 13 indicates that the individual state data properties can be referenced using this dot state. Line 14: open angle bracket forward slash div close angle bracket semicolon at indentation level 3. Line 15: close parenthesis semicolon at indentation level 2. Line 16: close curly brace at indentation level 1. Line 17: close curly brace at indentation level 0.
Back