basir / mern-amazona

Build Ecommerce Like Amazon By MERN Stack
https://www.youtube.com/watch?v=ZjwBs3n7waY&list=PLeh2GWv22bmSQ9oBSYTd469_AQjPGpzyv
329 stars 251 forks source link

correct the product.map function in lesson-08 #26

Open Anurag13975 opened 8 months ago

Anurag13975 commented 8 months ago

there is a issue in lesson-08-Fetch Products code (Link)

your code is {products.map((product) => ( but the corrected one is as below {products?.map((product) => (

because--

use products?.map then it will render correctly because we have fetched the data by sending request to API so first we have to check if the "products" existed or not.