title: 'history', no-restricted-globals, and window.history
body: <p>So I was running into an issue with React where if I tried to use 'history', my code wouldn't run telling me it's an 'unexpected use of <code>history</code> no-restricted-global'. </p>
  
  <p>I turned to StackOverflow in order to get help and surprisingly, I was able to find an answer to the issue that I was dealing with. </p>
  
  <p>The fix that another use suggested worked great, but now I'm confused as to why it worked in the first place. </p>
  
  <p>Using redux, I called a method via mapDispatchToProps. I needed to throw the 'history' in as one of the variables passed in so that I can redirect the user back to the previous page that they were on. </p>
  
  <p>Originally, I tried using just 'history' by itself as a variable but I would get a 'no-restricted-global' error when I tried to compile so I turned to StackOverflow. This is when they suggested I try using 'window.history'. I was skeptical at first because I didn't think something that simple would fix my issue but lo and behold, it compiled successfully. </p>
  
  <pre><code>props.addExperience(data, history);
  </code></pre>
  
  <p>vs.</p>
  
  <pre><code>props.addExperience(data, window.history);
  </code></pre>
  
  <p>the window.history works. Can someone please explain why the window.history works but history by itself doesn't work?</p>
  
  <p>what exactly is 'history'? what does 'window' do that fixes the issue?</p>
  
  <p>edit: <a href="https://stackoverflow.com/questions/44991656/no-restricted-globals">this</a> is the original StackOverflow post that I found. While Chasen Bettinger was able to fix the issue, he never really explained <em>why</em> the window. would fix the issue. If someone here can do that, that would be awesome. </p>