title: ReactJs -TimeTravel - FB tutorial - how does setState in jumpTo work?
body: <p>The following code is in time-travel section of reactjs tutorial from FB <a href="https://reactjs.org/tutorial/tutorial.html#adding-time-travel" rel="nofollow noreferrer">here</a>:</p>
  
  <pre><code> jumpTo(step) {
      this.setState({
        stepNumber: step,
        xIsNext: (step % 2) === 0,
      });
    }
  </code></pre>
  
  <p>How does <code>this.setState</code> exactly work in this code? IMO, it creates immutable copy of current state of <code>Game</code> and merges <code>stepNumber</code> and <code>xIsNext</code> properties into it. How does this exactly achieve time travel?  Shouldn't <code>jumpTo</code> delete history after the step?</p>