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:
<button onclick=reload>RESTART GAME</button>
function reload() {
location.reload();
}
For this react app what I thought would work was:
<button type=button onClick={ refreshPage }> <span>Reload</span> </button>
function refreshPage(){
window.location.reload();
}
to the App.js file but I'm getting the error message:
./src/App.js
Syntax error: Unexpected token (64:11)
62 | }
63 |
> 64 | function refreshPage(){
| ^
65 | window.location.reload();
66 | }
67 | }
The complete project can be found here github (npm start will launch the project in terminal/console)
Any insight into how to correct this would be much appreciated, thank you!