@docuong0912
Posted
Hi friend, i have a question Why does this line mean? const { id, type, desc, src } = product; why don't you use product.id, product.type,product.decs,..etc? i'm learnning react from your code, thank you for your time
@jhunxein
Posted
Hello @docuong0912 ! Sorry for my late reply.
It's called destructuring. I just destructure the object of product
so I don't have to repeat myself using product.(variable name)
every time I use it. You can read some explanation in Mozilla documentation