So, I was working on commerce.js API. But when I press add to cart, it takes a bit of time to update the cart items number (from API) so I thought I should add a loading button until the cart items load. I found LoadingButton from @mui/lab so I used it. but the problem is even though that button is inside the loop when pressing onClick all the other button also goes to the loading state. IDK am I missing something or is my coding false?. Please check below & help me. Thanks. :)
Here is the main problem.
Here is the app.js where you can see loading state & other API fetching
products component in app.js. you can see I passed down the products & loading props
products loop & props down to product component
finally the cart loading button in the product component with loading props. it works but all other buttons also loads at the same time.