#3 devlog, day 3
Today I finally made the timer and now this project could be actually called a “game”. It wasn’t easy to code the timer and make it work as it’s supposed. For some reason updating the timer updated the questions (which happened every second), but it was easy to fix when I figured out why it happened. (Why: the state timer component uses belonged to its parent component, where the questions are created. But when I updated time in timer component, it caused parent component to rerender again too. The way to fix that was to move question creating inside its own state and that way quesions are created only once.)
When the timer finally worked, I quickly added simple navigation structure using react router library. Adding that structure required some refactoring, but I will thank myself later for doing it so early. I was also a bit surprised but happy because nothing broke when I moved some components from one to another.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.