@@ -37,7 +37,7 @@ Install [Node.js and npm](https://nodejs.org/en/) if they are not already instal
3737- Update _ nameEdit.jsx_ in order to request the new _ editingUsername_ , and remove it
3838from the state.
3939
40- ``` javascript
40+ ``` jsx
4141import React from ' react' ;
4242
4343export class NameEditComponent extends React .Component {
@@ -70,30 +70,25 @@ children control and perform the proper update on the callback event from the
7070child control.
7171
7272
73- ``` javascript
74- import * as React from ' react' ;
73+ ``` jsx
74+ import React from ' react' ;
7575import {HelloComponent } from ' ./hello' ;
7676import {NameEditComponent } from ' ./nameEdit' ;
7777
78- interface State {
79- userName : string;
80- editingUserName : string;
81- }
82-
83- export class App extends React .Component < {}, State> {
78+ export class App extends React .Component {
8479 constructor (props ) {
8580 super (props);
8681
8782 const defaultUserName = ' defaultUserName' ;
8883 this .state = {userName: defaultUserName, editingUserName: defaultUserName};
8984 }
9085
91- setUsernameState () : void {
92- this .setState ({userName: this .state .editingUserName } as State );
86+ setUsernameState () {
87+ this .setState ({userName: this .state .editingUserName });
9388 }
9489
95- updateEditingName (editingName : string) : void {
96- this .setState ({editingUserName: editingName} as State );
90+ updateEditingName (editingName ) {
91+ this .setState ({editingUserName: editingName});
9792 }
9893
9994 render () {
@@ -108,7 +103,7 @@ export class App extends React.Component<{}, State> {
108103 );
109104 }
110105}
111- ```
106+ ```
112107
113- Finally we can check the sample is working as _ 04 Callback_ executing from the command line
114- ` npm start ` and opening [ http://localhost:8080 ] ( http://localhost:8080 ) .
108+ Finally we can check the sample is working as _ 04 Callback_ executing from the command line
109+ ` npm start ` and opening [ http://localhost:8080 ] ( http://localhost:8080 ) .
0 commit comments