Skip to content

Commit 73e8a61

Browse files
committed
Exampe component state count value changed to 1 in UNSAFE_componentWillMount() lifecycle method.
1 parent 29cd473 commit 73e8a61

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Example extends React.Component {
1313
UNSAFE_componentWillMount() {
1414
console.log('WillMountCount before is: ' + this.state.count);
1515
this.setState({
16-
count: 2
16+
count: 1
1717
});
1818
console.log('WillMountCount after is: ' + this.state.count);
1919
}

0 commit comments

Comments
 (0)