title: How to prevent state in React to not affect variables
body: <p>My code looks something like this</p>
  
  <pre><code>componentWillMount(){
      lotGroups = // backend call to fetch lotgroups
      setState({
          lotGroups
      )};
  }
  </code></pre>
  
  <p>As I am changing lotGroups later on (using setState only) I wanted to store the initial copy of the complete set of lotGroups.
  What would be the best way? I tried adding that variable to state and then updating it in componentWillMount(), but it did not work. As soon as the lotGroups updated, this got updated too.</p>