Submitted
Rock Paper Scissors in React
- HTML
- CSS
- JS
I enjoyed this challenge. My solution makes nice use of timings to render elements on the 'Result' page in order, but I stumbled into one main issue:
Updating the score doesn't happen until the 'Play Again' button is hit. This is because I couldn't figure out a way to update state and rerender the scoreboard component (to reflect the new score) without also re-rendering the main component. My solution is such that whenever the main component is rendered, a new random weapon is chosen for the house. I looked into ComponentShouldUpdate() and React.memo but ultimately didn't implement them.
Also had a few minor issues with styling on mobile, but fixed these (for the most part) using the Bootstrap grid 'order' classes. The main styling feature I bypassed was the 'depth' of the circles - I think this can be handled via box-shadow css.
Any feedback welcome.