Bug library · state · state
Stale quote after a quantity change
The price quote is memoised on the number of cart lines instead of the lines themselves, so + and - change nothing on screen until an item is added or removed or a coupon is applied.
The diff
components/Checkout.tsx- const quote = useMemo(() => computeQuote(lines, coupon), [lines, coupon]);+ // eslint-disable-next-line react-hooks/exhaustive-deps -- only recompute when the cart grows or shrinks+ const quote = useMemo(() => computeQuote(lines, coupon), [lines.length, coupon]);