File tree 9 files changed +22
-20
lines changed
examples/parent-child-demo/src
9 files changed +22
-20
lines changed Original file line number Diff line number Diff line change @@ -33,20 +33,20 @@ export default class Main extends Component {
33
33
state = {
34
34
selectedSampleIx : sessionSelectedSampleIx ? + sessionSelectedSampleIx : 0 ,
35
35
isShowingParent : true
36
- }
36
+ } ;
37
37
38
38
onCheckboxChange = ( evt ) => {
39
39
this . setState ( {
40
40
isShowingParent : evt . currentTarget . checked
41
41
} ) ;
42
- }
42
+ } ;
43
43
44
44
onSelectSample = ( evt ) => {
45
45
const selectedSampleIx = + evt . currentTarget . value ;
46
46
this . setState ( { selectedSampleIx} ) ;
47
47
sessionStorage . setItem ( sessionSelectedSampleIxKey , selectedSampleIx ) ;
48
48
clearLog ( ) ;
49
- }
49
+ } ;
50
50
51
51
render ( ) {
52
52
const selectedSample = sampleComponents [ this . state . selectedSampleIx ] ;
Original file line number Diff line number Diff line change @@ -12,20 +12,20 @@ export default class Parent extends Component {
12
12
state = {
13
13
showLastChild : true ,
14
14
x : 42
15
- }
15
+ } ;
16
16
17
17
onCheckboxChange = ( evt ) => {
18
18
this . setState ( {
19
19
showLastChild : evt . currentTarget . checked
20
20
} ) ;
21
- }
21
+ } ;
22
22
23
23
incX = ( ) => {
24
24
this . props . trace ( 'Custom message, calling incX' ) ;
25
25
this . setState ( ( { x} ) => {
26
26
return { x : x + 1 } ;
27
27
} ) ;
28
- }
28
+ } ;
29
29
30
30
componentWillMount ( ) {
31
31
this . props . trace ( 'Don\'t use componentWillMount!' ) ;
@@ -58,13 +58,13 @@ class Child extends Component {
58
58
state = {
59
59
y : 1 ,
60
60
squaredX : this . props . x ** 2
61
- }
61
+ } ;
62
62
63
63
incY = ( ) => {
64
64
this . setState ( ( prevState ) => {
65
65
return { y : prevState . y + 1 } ;
66
66
} ) ;
67
- }
67
+ } ;
68
68
69
69
componentWillReceiveProps ( nextProps ) {
70
70
this . setState ( { squaredX : nextProps . x ** 2 } ) ;
Original file line number Diff line number Diff line change @@ -11,20 +11,20 @@ export default class Parent extends Component {
11
11
state = {
12
12
showLastChild : true ,
13
13
x : 42
14
- }
14
+ } ;
15
15
16
16
onCheckboxChange = ( evt ) => {
17
17
this . setState ( {
18
18
showLastChild : evt . currentTarget . checked
19
19
} ) ;
20
- }
20
+ } ;
21
21
22
22
incX = ( ) => {
23
23
this . props . trace ( 'Custom message, calling incX' ) ;
24
24
this . setState ( ( { x} ) => {
25
25
return { x : x + 1 } ;
26
26
} ) ;
27
- }
27
+ } ;
28
28
29
29
render ( ) {
30
30
return (
@@ -52,13 +52,13 @@ export default class Parent extends Component {
52
52
class Child extends Component {
53
53
state = {
54
54
y : 1
55
- }
55
+ } ;
56
56
57
57
incY = ( ) => {
58
58
this . setState ( ( prevState ) => {
59
59
return { y : prevState . y + 1 } ;
60
60
} ) ;
61
- }
61
+ } ;
62
62
63
63
static getDerivedStateFromProps ( nextProps , prevState ) {
64
64
nextProps . trace ( 'nextProps: ' + JSON . stringify ( nextProps ) ) ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class Log extends Component {
29
29
break ;
30
30
}
31
31
}
32
- }
32
+ } ;
33
33
34
34
componentDidMount ( ) {
35
35
document . addEventListener ( 'keydown' , this . onKeyDown ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import React, { Component } from 'react';
3
3
export default class LogEntries extends Component {
4
4
highlight = ( index ) => {
5
5
this . props . highlight ( index ) ;
6
- }
6
+ } ;
7
7
8
8
componentDidUpdate ( prevProps ) {
9
9
if ( prevProps . entries . length !== this . props . entries . length ) {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const initialState = {
10
10
replayTimerDelay : sessionReplayTimerDelay ? + sessionReplayTimerDelay : constants . delayValues [ 1 ] ,
11
11
} ;
12
12
13
+ // eslint-disable-next-line default-param-last
13
14
export const reducer = ( state = initialState , action ) => {
14
15
// console.log('reducing', action, state);
15
16
switch ( action . type ) {
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ export default function traceLifecycle(ComponentToTrace) {
165
165
166
166
const instanceId = mkInstanceId ( ComponentToTrace . name ) ;
167
167
168
+ // eslint-disable-next-line react/no-unstable-nested-components
168
169
const WrappedLifecyclePanel = ( ) => (
169
170
< LifecyclePanel
170
171
componentName = { componentToTraceName }
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import React, { Component } from 'react';
2
2
import { traceLifecycle } from '../src' ;
3
3
4
4
class Child extends Component {
5
- state = { }
5
+ state = { } ;
6
6
7
- static staticProperty = 'a static property'
7
+ static staticProperty = 'a static property' ;
8
8
9
9
constructor ( props , context ) {
10
10
super ( props , context ) ;
@@ -56,7 +56,7 @@ class Child extends Component {
56
56
} , ( ) => {
57
57
this . props . trace ( 'custom:setState callback' ) ;
58
58
} ) ;
59
- }
59
+ } ;
60
60
}
61
61
62
62
const TracedChild = traceLifecycle ( Child ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import React, { Component } from 'react';
3
3
import { traceLifecycle } from '../src' ;
4
4
5
5
class LegacyChild extends Component {
6
- state = { }
6
+ state = { } ;
7
7
8
8
constructor ( props , context ) {
9
9
super ( props , context ) ;
@@ -56,7 +56,7 @@ class LegacyChild extends Component {
56
56
} , ( ) => {
57
57
this . props . trace ( 'custom:setState callback' ) ;
58
58
} ) ;
59
- }
59
+ } ;
60
60
}
61
61
62
62
const TracedLegacyChild = traceLifecycle ( LegacyChild ) ;
You can’t perform that action at this time.
0 commit comments