From 0dfd1cf9fc9906f34eb7e4d4f99a1cced09d9c02 Mon Sep 17 00:00:00 2001 From: Ben Wheeler Date: Thu, 17 Oct 2019 23:34:31 -0400 Subject: [PATCH] added comment about setting initial state --- src/components/join-flow/join-flow.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/join-flow/join-flow.jsx b/src/components/join-flow/join-flow.jsx index 387b37036..b3139677c 100644 --- a/src/components/join-flow/join-flow.jsx +++ b/src/components/join-flow/join-flow.jsx @@ -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 () {