Hi! I’m trying to build a simple quiz app to improve my react and hooks skills.
This is the GitHub Repo.
I’m fetching the data via custom hook from the OpenTrivia DB.
Then, i want to display a question card that contains both the questions and the answers. After clicking on the answer i want to show the next question.
To do so i have 2 pieces of state, questionNumber and answer. With useEffect i’m tracking when the answer change, to update the counter and push the selected answer into an array of answers.
Right now the app is a little mess, it doesn’t make the request to the Api, but i can’t figure out why. I don’t think that is an issue with the custom hooks, because it worked before.
Can i have some advice on what i’m doing wrong? I don’t want the code the make it function, just need to understand what’s not working. Thanks