MERN-ecommerce-Frontend icon indicating copy to clipboard operation
MERN-ecommerce-Frontend copied to clipboard

sir at 1:30:17 i am getting error saying that product.map is not a function please help

Open saqlain024 opened this issue 1 year ago • 2 comments

image

saqlain024 avatar Oct 11 '23 12:10 saqlain024

Try doing products && products.map i.e, only render when you have products or you can also make a Loader by using the loading state from the productSlice.js

So that you can display a loader till the product is loading

AyushOJOD avatar Nov 12 '23 10:11 AyushOJOD

use optional chaining over there --> products?.map(() => {})

pankajkandpal99 avatar Jan 03 '24 18:01 pankajkandpal99