@@ -24,18 +24,18 @@ Consider this route config:
24
24
25
25
| Component | Lifecycle Hooks called |
26
26
| -----------| ------------------------|
27
- | App | ` componentDidMount ` |
28
- | Home | ` componentDidMount ` |
27
+ | App | (2) ` componentDidMount ` |
28
+ | Home | (1) ` componentDidMount ` |
29
29
| Invoice | N/A |
30
30
| Account | N/A |
31
31
32
32
2 . Now they navigate from ` / ` to ` /invoices/123 `
33
33
34
34
| Component | Lifecycle Hooks called |
35
35
| -----------| ------------------------|
36
- | App | ` componentWillReceiveProps ` , ` componentDidUpdate ` |
37
- | Home | ` componentWillUnmount ` |
38
- | Invoice | ` componentDidMount ` |
36
+ | App | (1) ` componentWillReceiveProps ` , (4) ` componentDidUpdate ` |
37
+ | Home | (2) ` componentWillUnmount ` |
38
+ | Invoice | (3) ` componentDidMount ` |
39
39
| Account | N/A |
40
40
41
41
- ` App ` gets ` componentWillReceiveProps ` and ` componentDidUpdate ` because it
@@ -49,9 +49,9 @@ Consider this route config:
49
49
50
50
| Component | Lifecycle Hooks called |
51
51
| -----------| ------------------------|
52
- | App | ` componentWillReceiveProps ` , ` componentDidUpdate ` |
52
+ | App | (1) ` componentWillReceiveProps ` , (4) ` componentDidUpdate ` |
53
53
| Home | N/A |
54
- | Invoice | ` componentWillReceiveProps ` , ` componentDidUpdate ` |
54
+ | Invoice | (2) ` componentWillReceiveProps ` , (3) ` componentDidUpdate ` |
55
55
| Account | N/A |
56
56
57
57
All the components that were mounted before, are still mounted, they
@@ -61,10 +61,10 @@ Consider this route config:
61
61
62
62
| Component | Lifecycle Hooks called |
63
63
| -----------| ------------------------|
64
- | App | ` componentWillReceiveProps ` , ` componentDidUpdate ` |
64
+ | App | (1) ` componentWillReceiveProps ` , (4) ` componentDidUpdate ` |
65
65
| Home | N/A |
66
- | Invoice | ` componentWillUnmount ` |
67
- | Account | ` componentDidMount ` |
66
+ | Invoice | (2) ` componentWillUnmount ` |
67
+ | Account | (3) ` componentDidMount ` |
68
68
69
69
### Fetching Data
70
70
0 commit comments