Skip to content

Commit 594ce72

Browse files
committed
README updated to HEAD
1 parent 113002c commit 594ce72

File tree

2 files changed

+12
-17
lines changed

2 files changed

+12
-17
lines changed

05 Refactor/readme.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3838
from the state.
3939

40-
```javascript
40+
```jsx
4141
import React from 'react';
4242

4343
export class NameEditComponent extends React.Component {
@@ -70,30 +70,25 @@ children control and perform the proper update on the callback event from the
7070
child control.
7171

7272

73-
```javascript
74-
import * as React from 'react';
73+
```jsx
74+
import React from 'react';
7575
import {HelloComponent} from './hello';
7676
import {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).

05 Refactor/src/app.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from 'react';
1+
import React from 'react';
22
import {HelloComponent} from './hello';
33
import {NameEditComponent} from './nameEdit';
44

0 commit comments

Comments
 (0)