Can't convert empty array..

Posted at January 30, 2022 31 Views . 0 Saved .

Hi Rizwan...i am building flipkart clone through react with the help of your videos. Now i am facing an issue that is stopping me to progress further...the screenshot of error and code is attached below

Shantanu Aggarwal
Please Help me with this..It's very important
Rizwan Khan
Your cartItems is either undefined or null which cant be converted to object and Object.keys expects an object so plz have look on your cartItems if cartItems is undefined or null then it will give you this error
Shantanu Aggarwal
Actually i wronged the cart state with auth that's why this error pops up.. Now i fixed that part and error is gone but still thanks for advice