mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
added comment about setting initial state
This commit is contained in:
parent
16a1fccc27
commit
0dfd1cf9fc
1 changed files with 3 additions and 0 deletions
|
@ -36,6 +36,9 @@ class JoinFlow extends React.Component {
|
|||
step: 0,
|
||||
waiting: false
|
||||
};
|
||||
// it's ok to set state by reference, because state is treated as immutable,
|
||||
// so any changes to its fields will result in a new state which does not
|
||||
// reference its past fields
|
||||
this.state = this.initialState;
|
||||
}
|
||||
canTryAgain () {
|
||||
|
|
Loading…
Reference in a new issue