File tree 2 files changed +10
-4
lines changed
packages/victory-core/src/victory-util
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,9 @@ class App extends React.Component {
121
121
) ;
122
122
} ) }
123
123
</ ul >
124
- < Child />
124
+ < React . StrictMode >
125
+ < Child />
126
+ </ React . StrictMode >
125
127
</ div >
126
128
) ;
127
129
}
Original file line number Diff line number Diff line change @@ -45,17 +45,21 @@ export default (WrappedComponent, options) => {
45
45
}
46
46
const calculatedState = this . getStateChanges ( nextProps , calculatedValues ) ;
47
47
if ( ! isEqual ( this . calculatedState , calculatedState ) ) {
48
- this . calculatedState = calculatedState ;
49
- this . cacheValues ( calculatedValues ) ;
50
48
return true ;
51
49
}
52
50
if ( ! isEqual ( this . props , nextProps ) ) {
53
- this . cacheValues ( calculatedValues ) ;
54
51
return true ;
55
52
}
56
53
return false ;
57
54
}
58
55
56
+ componentDidUpdate ( prevProps ) {
57
+ const calculatedValues = this . getCalculatedValues ( prevProps ) ;
58
+ const calculatedState = this . getStateChanges ( prevProps , calculatedValues ) ;
59
+ this . calculatedState = calculatedState ;
60
+ this . cacheValues ( calculatedValues ) ;
61
+ }
62
+
59
63
// compile all state changes from own and parent state. Order doesn't matter, as any state
60
64
// state change should trigger a re-render
61
65
getStateChanges ( props , calculatedValues ) {
You can’t perform that action at this time.
0 commit comments