Design comparison
Solution retrospective
I would simplify my use of state management.
const [score, setScore] = useState(0);
const [rulesModal, setRulesModal] = useState(false);
const [player, setPlayer] = useState(null);
const [computer, setComputer] = useState(null);
const [picked, setPicked] = useState(false);
const [playerImage, setPlayerImage] = useState(null);
const [computerImage, setComputerImage] = useState(null);
const choices = ["rock", "paper", "scissors"];
const [result, setResult] = useState(null);
What challenges did you encounter, and how did you overcome them?
The main challenge was the animations, I used framer motion for the first time.
What specific areas of your project would you like help with?any feedback is appreciated.
Community feedback
- @VictorKevzPosted 9 days ago
Hey, great job on this one. As you indicated you had to overuse
useState
. Perhaps you can look intouseReducer Hook
, it will simplify state management. It's actually meant to handle complex state. A nice touch would be to combine it withuseContext hook aka the Context Api
.That way you won't have prop drilling issues as you can easily share state in your App. Framer motion is a good library for animations and I think you did well😁I hope it's useful
Marked as helpful1
Please log in to post a comment
Log in with GitHubJoin 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