Skip to content

Commit 45e1d59

Browse files
committed
Adds console.log line in getDerivedStateFromProps
1 parent b830762 commit 45e1d59

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

07/hello-react/src/LifeCycleSample.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class LifeCycleSample extends Component {
1010
console.log('constructor');
1111
}
1212
static getDerivedStateFromProps(nextProps, prevState) {
13+
console.log('getDerivedStateFromProps');
1314
if (nextProps.color !== prevState.color) {
1415
return { color: nextProps.color };
1516
}

0 commit comments

Comments
 (0)