high
react-bc-1
automated
confirmed by docs
Applied automatically
ReactDOM.render() is deprecated in React 18 (the app keeps running in legacy React 17 mode) — replace with createRoot().render()
3 files: src/index.jsx, src/legacy/toast.jsx, src/legacy/toast.test.jsx
Transformed 3 file(s); no remaining usages of the old API.
high
react-bc-2
automated
confirmed by docs
Applied automatically
ReactDOM.hydrate() is deprecated in React 18 (legacy mode) — replace with hydrateRoot()
1 file: src/ssr-entry.jsx
Transformed 1 file(s); no remaining usages of the old API.
medium
react-bc-3
automated
Applied automatically
act() from react-dom/test-utils is deprecated — import act from 'react' (available from React 18.3)
1 file: src/legacy/toast.test.jsx
Transformed 1 file(s); no remaining usages of the old API.
medium
react-bc-4
manual
confirmed by docs
Completed manually
Automatic batching: setState calls in timeouts/promises/native handlers are now batched — may affect code or tests relying on intermediate renders
How to fix Review any tests that assert on intermediate render states inside setTimeout, Promise.then, or native event handlers. Wrap those assertions in act() or use flushSync from 'react-dom' to opt out of automatic batching where needed.
4 files: src/App.jsx, src/components/AddItemForm.jsx, src/components/ItemList.jsx, src/components/SyncStatus.jsx
Completed manually: Audited async setState: only SyncStatus updates state in a promise callback; its test now expects the single batched render
low
react-bc-6
manual
confirmed by docs
Completed manually
Strict Mode now double-invokes effects (mount → unmount → mount) in development to surface side effects
How to fix Audit useEffect, useLayoutEffect, and class lifecycle methods for non-idempotent side effects (network requests, analytics calls, subscriptions). Ensure cleanup functions are implemented so double-invocation does not cause observable problems in development.
1 file: src/index.jsx
Completed manually: No component uses effects with external side effects; double-invoking is harmless
low
react-bc-7
manual
Completed manually
ReactDOM.unstable_batchedUpdates is redundant under React 18 automatic batching
How to fix With React 18's automatic batching, explicit calls to unstable_batchedUpdates are no longer needed in most cases. Remove them and verify behaviour. If you need to force synchronous rendering, use flushSync from 'react-dom' instead.
1 file: src/legacy/store.js
Completed manually: Removed unstable_batchedUpdates from store.js; subscribers are notified directly
medium
react-bc-8
manual
confirmed by docs
Completed manually
ReactDOM.unmountComponentAtNode() is deprecated in React 18 — call root.unmount() on the root returned by createRoot()
How to fix Keep the root returned by createRoot(container) and call root.unmount() instead of unmountComponentAtNode(container). In tests, unmount the root the test created (React Testing Library unmounts automatically).
1 file: src/legacy/toast.jsx
Completed manually: toast.jsx keeps the root returned by createRoot and calls root.unmount() instead of unmountComponentAtNode
low
react-bc-12
manual
confirmed by docs
Completed manually
Tests that render with react-dom directly need globalThis.IS_REACT_ACT_ENVIRONMENT = true under React 18
How to fix In the test setup file (e.g. setupTests.js / jest.setup.js), set globalThis.IS_REACT_ACT_ENVIRONMENT = true; so React 18 knows it runs in an act-aware test environment. React Testing Library ≥ 13 sets this automatically for tests that use it.
1 file: src/legacy/toast.test.jsx
Completed manually: Added jest.setup.js setting globalThis.IS_REACT_ACT_ENVIRONMENT = true (jest.setupFiles)