79294736

Date: 2024-12-19 15:14:08
Score: 1.5
Natty:
Report link

First thing first, I see you create the interval every 2 seconds and it is used to fetch from Api from time to time i believe this is the reason for the lag.

Also I think if you want to update the amount of item in the cart icon you can make the state in the parent or the top of the component instead and pass the count to the component props. So whenever the state updated the component props become updated too.

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: user15583511