Product List with cart in React

Solution retrospective
i would defiantly plan out my project more next time and think twice about where state management of certain components should live.
What challenges did you encounter, and how did you overcome them?I had originally tried managing the carts state in the cart component. I had forgotten i would have needed to access the carts quantity state from the add to cart buttons in the dessert cards. Once i realized this i moved all cart state to App.jsx, which is where i should have put it in the first place.
The add to cart button also caused me more trouble when i was using conditional rendering on the button tag itself as i was trying to render the plus and minus buttons inside the original button tag, not realising this wouldn't work as i cant nest buttons inside buttons. Instead i made the increase and decrease buttons spans with onClick events.
What specific areas of your project would you like help with?Would like help with fixing the no scroll behavior for when the Modal appears. I wanted it to be the same as the mobile design in that when the Modal pops up, it brings the user to the top of the page where the H1 title DESSERTS is visible in the background while displaying the Modal, but when i enabled any type of no scroll to stop background scrolling, it also restricted me to actually being able to bring the user to the top of the screen for when the Modal appears
Please log in to post a comment
Log in with GitHubCommunity feedback
- @dovelm
I really liked your work
Join 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