Design comparison
Solution retrospective
my second react project, Your feedback is highly recommended.
Community feedback
- @mukwende2000Posted over 1 year ago
First of all this is not a form, so handleSubmit doesn't fit as a name for the click handler. handleClick would be better, you shouldn't fetch data outside of a useEffect, so the handleSubmit should not be fetching the data, instead i suggest you set a certain state and change the state when you click the button, and to trigger the fetch, you can add that state in the dependecy array. Lastly i really can't see the reason why your looping through the slip. It is not an array you can just do fine by extracting the id and the advice directly into the jsx.
Marked as helpful0@ify47Posted over 1 year ago@mukwende2000
thanks for the feedback, i have made the necessary changes, i understood my mistakes and learned from it,
Also i am passing a usEffect to call the api on page load once, I look forward to getting more feedback from you, thanks :)
1 - @mukwende2000Posted over 1 year ago
yeah, that look much better now, never stop learning, congratulations on completing the challenge
0
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