-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
The site looks really neat!!!
I noticed this one pattern that happens a few times:
setBirdcage((prevCage) => {
return prevCage.map((b) =>
b.id === bird.id ? { ...b, quantity: b.quantity - 1 } : b
);
});This is a silly issue to add, BUT:
- love the ternary, nice one;
- naming the mapped bird as 'b' got confusing to my tired out brain. I do actually think sometimes being more descriptive is preferable, like:
setBirdcage((prevCage) => {
return prevCage.map((cagedBird) =>
cagedBird.id === bird.id ? { ...b, quantity: cagedBird.quantity - 1 } : cagedBird
);
});Metadata
Metadata
Assignees
Labels
No labels