Skip to content

React Review Audit #1

@reactreview

Description

@reactreview

Score: 94/100 · 0 errors · 18 warnings

Copy as prompt
Fix the following React Review diagnostics in my codebase.

## Warnings (18)

1. [warning] no-array-index-as-key — src/components/SkeletonCard.js:13
   Array index "index" used as key — causes bugs when list is reordered or filtered

2. [warning] click-events-have-key-events — src/components/Main.js:68
   Enforce a clickable non-interactive element has at least one keyboard event listener.

3. [warning] no-react19-deprecated-apis — src/components/Main.js:1
   useContext is superseded by `use()` on React 19+ — `use()` reads context conditionally inside hooks, branches, and loops; switch to `import { use } from 'react'`

4. [warning] no-array-index-as-key — src/components/Main.js:36
   Array index "i" used as key — causes bugs when list is reordered or filtered

5. [warning] click-events-have-key-events — src/components/SearchLocation.js:18
   Enforce a clickable non-interactive element has at least one keyboard event listener.

6. [warning] no-array-index-as-key — src/components/SearchLocation.js:17
   Array index "index" used as key — causes bugs when list is reordered or filtered

7. [warning] no-react19-deprecated-apis — src/components/Search.js:1
   useContext is superseded by `use()` on React 19+ — `use()` reads context conditionally inside hooks, branches, and loops; switch to `import { use } from 'react'`

8. [warning] rerender-functional-setstate — src/components/Search.js:39
   setAdultCount(adultCount + ...) — use functional update to avoid stale closures

9. [warning] rerender-functional-setstate — src/components/Search.js:42
   setAdultCount(adultCount - ...) — use functional update to avoid stale closures

10. [warning] rerender-functional-setstate — src/components/Search.js:45
   setChildrenCount(childrenCount + ...) — use functional update to avoid stale closures

11. [warning] rerender-functional-setstate — src/components/Search.js:48
   setChildrenCount(childrenCount - ...) — use functional update to avoid stale closures

12. [warning] no-generic-handler-names — src/components/Search.js:82
   Non-descriptive handler name "handleClick" — name should describe what it does, not when it runs

13. [warning] no-generic-handler-names — src/components/Search.js:138
   Non-descriptive handler name "handleClick" — name should describe what it does, not when it runs

14. [warning] rendering-svg-precision — src/components/Logo.js:11
   SVG d attribute uses 4+ decimal precision — truncate to 1–2 decimals to shrink markup with no visible difference

15. [warning] rendering-svg-precision — src/components/Logo.js:15
   SVG d attribute uses 4+ decimal precision — truncate to 1–2 decimals to shrink markup with no visible difference

16. [warning] no-react-dom-deprecated-apis — src/index.js:5
   ReactDOM.render is the legacy root API — switch to `import { createRoot } from 'react-dom/client'` and call `createRoot(container).render(...)` (REMOVED in React 19)

17. [warning] no-react19-deprecated-apis — src/components/Header.js:1
   useContext is superseded by `use()` on React 19+ — `use()` reads context conditionally inside hooks, branches, and loops; switch to `import { use } from 'react'`

18. [warning] no-cascading-set-state — src/App.js:13
   3 setState calls in a single useEffect — consider using useReducer or deriving state

⚠️ Warnings (18)

rerender-functional-setstate

setAdultCount(adultCount + ...) — use functional update to avoid stale closures

Use the callback form: setState(prev => prev + 1) to always read the latest value

src/components/Search.js:39
src/components/Search.js:42
src/components/Search.js:45
src/components/Search.js:48

no-array-index-as-key

Array index "index" used as key — causes bugs when list is reordered or filtered

Use a stable unique identifier: key={item.id} or key={item.slug} — index keys break on reorder/filter

src/components/SkeletonCard.js:13
src/components/Main.js:36
src/components/SearchLocation.js:17

no-react19-deprecated-apis

useContext is superseded by use() on React 19+ — use() reads context conditionally inside hooks, branches, and loops; switch to import { use } from 'react'

Pass ref as a regular prop on function components — forwardRef is no longer needed in React 19+. Replace useContext(X) with use(X) for branch-aware context reads. Only enabled on projects detected as React 19+.

src/components/Main.js:1
src/components/Search.js:1
src/components/Header.js:1

click-events-have-key-events

Enforce a clickable non-interactive element has at least one keyboard event listener.

Visible, non-interactive elements with click handlers must have one of keyup, keydown, or keypress listener.

src/components/Main.js:68
src/components/SearchLocation.js:18

no-generic-handler-names

Non-descriptive handler name "handleClick" — name should describe what it does, not when it runs

Rename to describe the action: e.g. handleSubmitsaveUserProfile, handleClicktoggleSidebar

src/components/Search.js:82
src/components/Search.js:138

rendering-svg-precision

SVG d attribute uses 4+ decimal precision — truncate to 1–2 decimals to shrink markup with no visible difference

Truncate path/points/transform decimals to 1–2 digits — sub-pixel precision adds bytes with no visible difference

src/components/Logo.js:11
src/components/Logo.js:15

no-react-dom-deprecated-apis

ReactDOM.render is the legacy root API — switch to import { createRoot } from 'react-dom/client' and call createRoot(container).render(...) (REMOVED in React 19)

Switch the legacy react-dom root API (render / hydrate / unmountComponentAtNode) to createRoot / hydrateRoot / root.unmount() from react-dom/client. Replace findDOMNode with a ref. The whole react-dom/test-utils entry point is removed in React 19 — use act from react and fireEvent / render from @testing-library/react. Only enabled on projects detected as React 18+.

src/index.js:5

no-cascading-set-state

3 setState calls in a single useEffect — consider using useReducer or deriving state

Combine into useReducer: const [state, dispatch] = useReducer(reducer, initialState)

src/App.js:13


Last scored May 13, 2026 at 5:49 PM UTC. Maintained by React Review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions