You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 04 Callback/readme.md
+10-13
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,15 @@
1
1
# 04 Callback + State
2
2
3
-
In this sample we are going to refactor the previous sample **03 State**.
3
+
In this example we refactor the previous **03 State** example.
4
4
5
-
We'll update the name property only when the user clicks on
6
-
a _change_ button, we will simplify the event itself as well.
5
+
We update the name property only when the user clicks a _change_ button, and we simplify the event itself as well.
7
6
8
-
Obviously, we will take the sample**03 State** as a starting point.
7
+
Obviously, we take the example**03 State** as a starting point.
9
8
10
9
Summary steps:
11
10
12
11
- Add a button to the `EditName` component and a handler function for this.
13
-
- Submit the name only when the user clicks on the button.
12
+
- Submit the name only when the user clicks that button.
14
13
- Update the `app` component to handle the new simplified event.
15
14
16
15
## Prerequisites
@@ -21,19 +20,17 @@ Install [Node.js and npm](https://nodejs.org/en/) (v6.6.0) if they are not alrea
21
20
22
21
## Steps to build it
23
22
24
-
- Copy the content of the `03 State` folder to an empty folder for the sample
25
-
and make this your current folder.
23
+
- Copy the content of the `03 State` folder to an empty folder for this example and make this your current folder.
26
24
27
25
- Install the npm packages described in the `package.json` and verify that it works:
28
26
29
27
```bash
30
28
npm install
31
29
```
32
30
33
-
- Since we are going to use an internal handler, we'll transform the `NameEditComponent`
34
-
from a stateless component into a class component, then we will add some refactor on the naming.
31
+
- Since we are going to use an internal handler, we'll transform the `NameEditComponent` from a stateless component into a class component, then we will add some refactor on the naming.
0 commit comments