Exercise 1: Why Zero Lines Need to Change — Possible Solution ==================================================================== WHY useBarcodeScanner ITSELF NEEDS NO CHANGES ------------------------------ The hook never imports, calls, or references anything backend-related — no fetch to a specific URL, no ORM, no database client. It only ever calls one thing, onDetected(barcode), a plain callback the parent component supplies. Since the hook has no awareness of what onDetected actually does internally, nothing about how the backend stores or queries data could possibly require a change here. WHY EVEN THE ONE LINE THAT DIFFERED BETWEEN THE OTHER TWO COURSES STAYS THE SAME HERE ------------------------------ Food Tracker (React + Firebase) and Food Tracker (React + Express) differ in handleDetected by exactly one line, because one calls a Cloud Function and the other calls a REST endpoint - genuinely different transport mechanisms. This course and Food Tracker (React + Express) both call the identical REST endpoint, fetch("/api/lookup/ ${barcode}"), because Chapter 3's route path (/api/lookup/:barcode) never changed between those two courses. Switching the route's own internal implementation from raw SQL via better-sqlite3 to Prisma changed what happens inside that route - not its URL, not its HTTP method, and not the fact that it still returns JSON. From the frontend's perspective, calling that route looks identical either way. WHY THIS WORKS AS AN ANSWER ------------------------------ It correctly identifies that the hook's own total backend-ignorance is what makes it reusable at all, and it correctly distinguishes "the route's internal implementation changed" from "the route's own public contract (URL, method, response shape) changed" - only the first is true here, which is exactly why the frontend component notices nothing.