Rock paper scissors lizard spock using React

Solution retrospective
I think that react code could be improved...any hints and suggestions are appreciated
Please log in to post a comment
Log in with GitHubCommunity feedback
- @mattstuddert
Hey Marko, awesome work on this challenge. Your React code looks absolutely fine. I would only make small changes, such as:
- Instead of using
element.style.display = 'none'
in various places I would use a logical operator to conditional render the component or not. This would mean theRulesModal
in yourApp.js
would become{ rules && <RulesModal setRules={setRules} />}
. You'd then be callingsetRules(false)
to close it in the model component. - I'd also recommend breaking up your code into smaller components. For example, instead of having 5
button
elements repeated in theGame.js
you'd have 5 calls to a component that would render abutton
and change the props based on what's passed down.
These are small things though. Overall, you've done a really good job. How are you liking React so far?
- Instead of using
- @siddtheone
Very nice, however at resolution ~800px, there is white background with purple background
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord