Design comparison
Solution retrospective
I am most proud of my data management and distribution using useContext and useReducer for the first time in my own project is a massive achievement for me.
What challenges did you encounter, and how did you overcome them?Walking into this project I knew it was going to be difficult, despite the functionality and the user experience seeming very simple, I knew that I was dealing with data fetching and more complex state management. Therefore the following mental notes were made:
- The dessert list is only rendered and not used anywhere else, and therefore needs to be fetched and stored in some useState variable
- The cart list is a bit more complex and needs to be updated depending on user interactions, plus it needs to be display when the user confirms their order, this calls for useContext
- Due to mulitple state updates happening at a click of a button, useReducer is a necessity
- Since I was fetching data, useEffect was needed coupled with useCallback to avoid infinite re-renders
If there are any components that are able to be abstracted, please let me know!
Community feedback
- @progressive-newbie263Posted 3 months ago
i am speechless haha. You sir did a really great job, much better than mine, so i can't give any helpful comment to you. The useReducer felt like a miracle to an also newbie at React like me. Keep up the great work man.
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