@mattstuddert
Posted
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?
@MarkoNikolajevic
Posted
@mattstuddert thank you for the feedbacks! I will improve it as you suggested. I love React, just still struggling with states and hooks