Fix deprecated React/Apollo Client console warnings - #679
Conversation
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/2d93b249-5142-43e9-9501-ec2731be7613 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
Agent-Logs-Url: https://github.com/conorheffron/ironoc/sessions/2d93b249-5142-43e9-9501-ec2731be7613 Co-authored-by: conorheffron <8218626+conorheffron@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to eliminate frontend console warnings caused by deprecated/removed APIs across React Router, Apollo Client, and invalid/unreachable React markup.
Changes:
- Updates Apollo Client setup to use an explicit
HttpLinkand instantiates the client once inApp’s constructor. - Removes the deprecated
forceRefreshprop from the router configuration. - Deletes unreachable JSX in
Donate.jsthat included invalid HTML heading tags. - Adds
@testing-library/domto the frontend dependency set (with corresponding lockfile updates).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/src/App.js | Switches Apollo Client creation to HttpLink and makes it a single instance; removes forceRefresh usage. |
| frontend/src/components/Donate.js | Removes unreachable duplicate return block containing invalid HTML tags. |
| frontend/package.json | Adds @testing-library/dom to dependencies. |
| frontend/package-lock.json | Updates lockfile to include new dependency and includes additional dependency resolution/version changes. |
Files not reviewed (1)
- frontend/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@copilot resolve the merge conflicts in this pull request |
|
@copilot resolve the merge conflicts in this pull request |
Resolved the merge conflicts and pushed the merge commit in |
Resolved in |
Multiple console warnings/errors from deprecated or removed APIs:
findDOMNodedeprecation via reactstrap'sCollapse/Navbar, Apollo Client 3.14+urishorthand removal, React Router v7 droppingforceRefresh, and unreachable dead code with invalid HTML tags inDonate.js.Changes
App.jsurishorthand with explicitHttpLink. Apollo Client 3.14+ emitsconsole.warnwhenuriis passed directly toApolloClient:render()to constructor — was creating a new instance (and re-emitting warnings) on every renderforceRefreshprop: Removed from<BrowserRouter>— prop was dropped in React Router v7; passing it generates unknown-prop warningsDonate.jsreturnblock containing invalid HTML elements (<h8>,<h7>,<h11>) that would produce browser console errors