File tree Expand file tree Collapse file tree 9 files changed +22
-20
lines changed
examples/parent-child-demo/src Expand file tree Collapse file tree 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 {
3333 state = {
3434 selectedSampleIx : sessionSelectedSampleIx ? + sessionSelectedSampleIx : 0 ,
3535 isShowingParent : true
36- }
36+ } ;
3737
3838 onCheckboxChange = ( evt ) => {
3939 this . setState ( {
4040 isShowingParent : evt . currentTarget . checked
4141 } ) ;
42- }
42+ } ;
4343
4444 onSelectSample = ( evt ) => {
4545 const selectedSampleIx = + evt . currentTarget . value ;
4646 this . setState ( { selectedSampleIx} ) ;
4747 sessionStorage . setItem ( sessionSelectedSampleIxKey , selectedSampleIx ) ;
4848 clearLog ( ) ;
49- }
49+ } ;
5050
5151 render ( ) {
5252 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 {
1212 state = {
1313 showLastChild : true ,
1414 x : 42
15- }
15+ } ;
1616
1717 onCheckboxChange = ( evt ) => {
1818 this . setState ( {
1919 showLastChild : evt . currentTarget . checked
2020 } ) ;
21- }
21+ } ;
2222
2323 incX = ( ) => {
2424 this . props . trace ( 'Custom message, calling incX' ) ;
2525 this . setState ( ( { x} ) => {
2626 return { x : x + 1 } ;
2727 } ) ;
28- }
28+ } ;
2929
3030 componentWillMount ( ) {
3131 this . props . trace ( 'Don\'t use componentWillMount!' ) ;
@@ -58,13 +58,13 @@ class Child extends Component {
5858 state = {
5959 y : 1 ,
6060 squaredX : this . props . x ** 2
61- }
61+ } ;
6262
6363 incY = ( ) => {
6464 this . setState ( ( prevState ) => {
6565 return { y : prevState . y + 1 } ;
6666 } ) ;
67- }
67+ } ;
6868
6969 componentWillReceiveProps ( nextProps ) {
7070 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 {
1111 state = {
1212 showLastChild : true ,
1313 x : 42
14- }
14+ } ;
1515
1616 onCheckboxChange = ( evt ) => {
1717 this . setState ( {
1818 showLastChild : evt . currentTarget . checked
1919 } ) ;
20- }
20+ } ;
2121
2222 incX = ( ) => {
2323 this . props . trace ( 'Custom message, calling incX' ) ;
2424 this . setState ( ( { x} ) => {
2525 return { x : x + 1 } ;
2626 } ) ;
27- }
27+ } ;
2828
2929 render ( ) {
3030 return (
@@ -52,13 +52,13 @@ export default class Parent extends Component {
5252class Child extends Component {
5353 state = {
5454 y : 1
55- }
55+ } ;
5656
5757 incY = ( ) => {
5858 this . setState ( ( prevState ) => {
5959 return { y : prevState . y + 1 } ;
6060 } ) ;
61- }
61+ } ;
6262
6363 static getDerivedStateFromProps ( nextProps , prevState ) {
6464 nextProps . trace ( 'nextProps: ' + JSON . stringify ( nextProps ) ) ;
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class Log extends Component {
2929 break ;
3030 }
3131 }
32- }
32+ } ;
3333
3434 componentDidMount ( ) {
3535 document . addEventListener ( 'keydown' , this . onKeyDown ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import React, { Component } from 'react';
33export default class LogEntries extends Component {
44 highlight = ( index ) => {
55 this . props . highlight ( index ) ;
6- }
6+ } ;
77
88 componentDidUpdate ( prevProps ) {
99 if ( prevProps . entries . length !== this . props . entries . length ) {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ const initialState = {
1010 replayTimerDelay : sessionReplayTimerDelay ? + sessionReplayTimerDelay : constants . delayValues [ 1 ] ,
1111} ;
1212
13+ // eslint-disable-next-line default-param-last
1314export const reducer = ( state = initialState , action ) => {
1415 // console.log('reducing', action, state);
1516 switch ( action . type ) {
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ export default function traceLifecycle(ComponentToTrace) {
165165
166166 const instanceId = mkInstanceId ( ComponentToTrace . name ) ;
167167
168+ // eslint-disable-next-line react/no-unstable-nested-components
168169 const WrappedLifecyclePanel = ( ) => (
169170 < LifecyclePanel
170171 componentName = { componentToTraceName }
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ import React, { Component } from 'react';
22import { traceLifecycle } from '../src' ;
33
44class Child extends Component {
5- state = { }
5+ state = { } ;
66
7- static staticProperty = 'a static property'
7+ static staticProperty = 'a static property' ;
88
99 constructor ( props , context ) {
1010 super ( props , context ) ;
@@ -56,7 +56,7 @@ class Child extends Component {
5656 } , ( ) => {
5757 this . props . trace ( 'custom:setState callback' ) ;
5858 } ) ;
59- }
59+ } ;
6060}
6161
6262const TracedChild = traceLifecycle ( Child ) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import React, { Component } from 'react';
33import { traceLifecycle } from '../src' ;
44
55class LegacyChild extends Component {
6- state = { }
6+ state = { } ;
77
88 constructor ( props , context ) {
99 super ( props , context ) ;
@@ -56,7 +56,7 @@ class LegacyChild extends Component {
5656 } , ( ) => {
5757 this . props . trace ( 'custom:setState callback' ) ;
5858 } ) ;
59- }
59+ } ;
6060}
6161
6262const TracedLegacyChild = traceLifecycle ( LegacyChild ) ;
You can’t perform that action at this time.
0 commit comments