Submitted over 1 year ago
e-commerce product page using React SASS and TypeScript
@flaviogp
Design comparison
SolutionDesign
Solution retrospective
Hi there š, Iām Flavio and this is my solution for this challenge. š
š ļø Built With:
- sass/scss
- TypeScript
- React
Any suggestions on how I can improve and reduce unnecessary code are welcome!
Thank you. šāļø
Community feedback
- @fazzaamiarsoPosted over 1 year ago
Hi Flavio! Nice Solution!
I have a quick tip for you, you can use
.filter
instead of.splice
to remove an item from Array.// You can use just the ID to filter or find something const removeProductToCart = (productId: number ): void =>{ setProducts(prevProducts => prevProducts.filter(prod => prod.id !== productId)) }
Hope it helps! Cheers!
Marked as helpful1@flaviogpPosted over 1 year ago@fazzaamiarso
Thanks for the tip! I'll update the code and put your tip into practice in future projects :)
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