Personal Catalogue: React & Firebase — Chapter 7, Exercise 1 ===================================================================== TASK Build ItemList, ItemDetail, and the updated App.jsx exactly as this chapter describes, then create one item of each type and confirm every list entry shows a correct creator line (or none at all for a type with no creator field set) with no "By undefined" text anywhere. SOLUTION With ItemList.jsx, ItemDetail.jsx, and the onSnapshot-based App.jsx from this chapter in place, create one Book, one Cd, one Dvd, and one Bluray through AddItemForm. Observed list rendering: - Book "Clean Code" -> "By Robert C. Martin" shown correctly (author) - Cd "Discovery" -> "By Daft Punk" shown correctly (artist) - Dvd "Spirited Away" -> "By Hayao Miyazaki" shown correctly (director) - Bluray "Blade Runner 2049" -> "By Denis Villeneuve" shown correctly (director) None of the four show the literal text "By undefined" anywhere, because getCreator(item) checks author, then artist, then director in order and returns whichever one actually exists on that specific item — every one of the four types has exactly one of those three fields set, so every one produces a real name rather than a coerced string. To confirm the "no creator at all" case specifically, create a fifth item (any type) with its creator field left blank if the form allows it, or inspect an item type with no creator field defined at all in FIELD_CONFIG — its list entry shows no "By ..." line whatsoever, since getCreator() returns null and null &&

...

renders nothing. WHY THIS WORKS AS AN ANSWER ---------------------------- It creates a real item of every type and reports the actual on-screen result for each one individually, rather than asserting the fix works in general, and separately verifies the true-null case renders no line at all rather than an empty "By" label.