Fix the following React Review diagnostics in my codebase.
## Errors (9)
1. [error] alt-text — src/Components/Checkout/Checkout.js:18
Missing `alt` attribute.
2. [error] alt-text — src/Components/Product/Product.js:69
Missing `alt` attribute.
3. [error] alt-text — src/Components/Header/Header.js:37
Missing `alt` attribute.
4. [error] alt-text — src/Components/Login/Login.js:68
Missing `alt` attribute.
5. [error] jsx-key — src/Components/Orders/Orders.js:60
Missing "key" prop for element in iterator.
6. [error] alt-text — src/Components/ProductView/ProductView.js:124
Missing `alt` attribute.
7. [error] alt-text — src/Components/ProductView/ProductView.js:131
Missing `alt` attribute.
8. [error] alt-text — src/Components/ProductView/ProductView.js:138
Missing `alt` attribute.
9. [error] alt-text — src/Components/ProductView/ProductView.js:145
Missing `alt` attribute.
## Warnings (17)
10. [warning] rendering-hydration-mismatch-time — src/Components/Checkout/Checkout.js:28
Date.now() reachable from JSX renders differently on server vs client — wrap in useEffect+useState (client-only) or add suppressHydrationWarning to the parent if intentional
11. [warning] no-array-index-as-key — src/Components/Product/Product.js:63
Array index "i" used as key — causes bugs when list is reordered or filtered
12. [warning] prefer-useReducer — src/Components/Payment/Payment.js:12
Component "Payment" has 5 useState calls — consider useReducer for related state
13. [warning] rerender-state-only-in-handlers — src/Components/Payment/Payment.js:23
useState "clientSecret" is updated but never read in the component's return — use useRef so updates don't trigger re-renders
14. [warning] rendering-hydration-mismatch-time — src/Components/Payment/Payment.js:117
Date.now() reachable from JSX renders differently on server vs client — wrap in useEffect+useState (client-only) or add suppressHydrationWarning to the parent if intentional
15. [warning] no-generic-handler-names — src/Components/Payment/Payment.js:135
Non-descriptive handler name "handleChange" — name should describe what it does, not when it runs
16. [warning] click-events-have-key-events — src/Components/Header/Header.js:71
Enforce a clickable non-interactive element has at least one keyboard event listener.
17. [warning] click-events-have-key-events — src/Components/Header/Header.js:82
Enforce a clickable non-interactive element has at least one keyboard event listener.
18. [warning] no-static-element-interactions — src/Components/Header/Header.js:71
Static HTML elements with event handlers require a role.
19. [warning] no-static-element-interactions — src/Components/Header/Header.js:82
Static HTML elements with event handlers require a role.
20. [warning] no-autofocus — src/Components/CustomPopup/CustomPopup.js:35
The `autoFocus` attribute is found here, which can cause usability issues for sighted and non-sighted users.
21. [warning] design-no-vague-button-label — src/Components/CustomPopup/CustomPopup.js:35
Vague button label "OK!!!" — name the action ("Save changes", "Send invite", "Delete account") so screen readers and hesitant users know what happens
22. [warning] no-array-index-as-key — src/Components/ProductView/ProductView.js:118
Array index "i" used as key — causes bugs when list is reordered or filtered
23. [warning] js-combine-iterations — src/Components/ProductRow/ProductRow.js:13
.filter().map() iterates the array twice — combine into a single loop with .reduce() or for...of
24. [warning] no-array-index-as-key — src/Components/CheckoutProduct/CheckoutProduct.js:41
Array index "i" used as key — causes bugs when list is reordered or filtered
25. [warning] no-moment — src/Components/Order/Order.js:5
moment.js is 300kb+ — use "date-fns" or "dayjs" instead
26. [warning] no-fetch-in-effect — src/App.js:25
fetch() inside useEffect — use a data fetching library (react-query, SWR) or server component
Copy as prompt
❌ Errors (9)
Missing `alt` attribute. · 8 in 5 files
alt-textsrc/Components/ProductView/ProductView.jssrc/Components/Checkout/Checkout.jssrc/Components/Product/Product.jssrc/Components/Header/Header.jssrc/Components/Login/Login.jsMissing "key" prop for element in iterator. · 1 in 1 file
jsx-keysrc/Components/Orders/Orders.jsArray index "i" used as key — causes bugs when list is reordered or filtered · 3 in 3 files
no-array-index-as-keysrc/Components/Product/Product.jssrc/Components/ProductView/ProductView.jssrc/Components/CheckoutProduct/CheckoutProduct.jsDate.now() reachable from JSX renders differently on server vs client — wrap in useEffect+useState (client-only) or add suppressHydrationWarning to the parent if intentional · 2 in 2 files
rendering-hydration-mismatch-timesrc/Components/Checkout/Checkout.jssrc/Components/Payment/Payment.jsEnforce a clickable non-interactive element has at least one keyboard event listener. · 2 in 1 file
click-events-have-key-eventssrc/Components/Header/Header.jsStatic HTML elements with event handlers require a role. · 2 in 1 file
no-static-element-interactionssrc/Components/Header/Header.jsComponent "Payment" has 5 useState calls — consider useReducer for related state · 1 in 1 file
prefer-useReducersrc/Components/Payment/Payment.jsuseState "clientSecret" is updated but never read in the component's return — use useRef so updates don't trigger re-renders · 1 in 1 file
rerender-state-only-in-handlerssrc/Components/Payment/Payment.jsNon-descriptive handler name "handleChange" — name should describe what it does, not when it runs · 1 in 1 file
no-generic-handler-namessrc/Components/Payment/Payment.jsThe `autoFocus` attribute is found here, which can cause usability issues for sighted and non-sighted users. · 1 in 1 file
no-autofocussrc/Components/CustomPopup/CustomPopup.jsVague button label "OK!!!" — name the action ("Save changes", "Send invite", "Delete account") so screen readers and hesitant users know what happens · 1 in 1 file
design-no-vague-button-labelsrc/Components/CustomPopup/CustomPopup.js.filter().map() iterates the array twice — combine into a single loop with .reduce() or for...of · 1 in 1 file
js-combine-iterationssrc/Components/ProductRow/ProductRow.jsmoment.js is 300kb+ — use "date-fns" or "dayjs" instead · 1 in 1 file
no-momentsrc/Components/Order/Order.jsfetch() inside useEffect — use a data fetching library (react-query, SWR) or server component · 1 in 1 file
no-fetch-in-effectsrc/App.jsReviewed by reactreview for commit 034b2ac. Configure here.