Shopping cart using React

Solution retrospective
-
Component structure: Some parts of the UI share overlapping logic or layout but were built separately. With better planning, I could extract those into shared reusable components to reduce repetition and improve maintainability.
-
CSS organization: Currently, styles are split into separate CSS files for each component. However, some class names are unintentionally reused across components, which may lead to unexpected style overrides. Going forward, I want to implement a more robust naming convention or use CSS Modules to avoid clashes.
One challenge I frequently encountered was forgetting to keep the UI and state in sync. For example, after updating the state, I sometimes expected the UI to reflect the change immediately without properly handling re-renders or conditional rendering.
To overcome this, I started using React DevTools to monitor state changes more closely. I also began writing simple checklists before coding each component to ensure I consider both data and presentation layers together.
What specific areas of your project would you like help with?I would appreciate help with improving my use of components. Currently, I feel that some components are not used correctly or could be better consolidated into a single reusable component. Guidance on best practices for component design and reuse would be very helpful.
Please log in to post a comment
Log in with GitHubCommunity feedback
No feedback yet. Be the first to give feedback on Peetawit Vongchanapibul's solution.
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