title: How to reload a page (state) in a react app
body: <p>I'm beginning to learn react.js and I've developer a simple rock paper scissors game in a react app. I'm finding it a bit difficult creating a reload button because it is of course different from the javascript button with a function like:</p>
  
  <pre><code>&lt;button onclick="reload"&gt;RESTART GAME&lt;/button&gt;
  function reload() {
    location.reload();
  }
  </code></pre>
  
  <p>For this react app what I thought would work was:</p>
  
  <pre><code>&lt;button type="button" onClick={ refreshPage }&gt; &lt;span&gt;Reload&lt;/span&gt; &lt;/button&gt;
  function refreshPage(){ 
    window.location.reload(); 
  }
  </code></pre>
  
  <p>to the App.js file but I'm getting the error message:</p>
  
  <pre><code>./src/App.js
  Syntax error: Unexpected token (64:11)
  
    62 |   }
    63 | 
  &gt; 64 |   function refreshPage(){
       |            ^
    65 |     window.location.reload();
    66 |   }
    67 | } 
  </code></pre>
  
  <p>The complete project can be found here <a href="https://github.com/tobi-ajala/react-rockpaperscissors" rel="noreferrer">github</a> (npm start will launch the project in terminal/console)</p>
  
  <p>Any insight into how to correct this would be much appreciated, thank you!</p>