Skip to content

chore(deps): upgrade React 18.3 → 19 - #3384

Merged
jeanfbrito merged 1 commit into
masterfrom
chore/react-19
Jul 8, 2026
Merged

chore(deps): upgrade React 18.3 → 19#3384
jeanfbrito merged 1 commit into
masterfrom
chore/react-19

Conversation

@jeanfbrito

@jeanfbrito jeanfbrito commented Jun 30, 2026

Copy link
Copy Markdown
Member

CORE-2398

Stacked PR — targets chore/fuselage-080 (#3383). Merge #3383 first; this re-targets to master after. Fuselage 0.80 ships React 19 peer support, which is the prerequisite for this upgrade.

What changed

Upgrades the renderer from React 18.3.1 → React 19.2.7, plus the ecosystem libraries to their React-19-compatible floors.

Core

Package From To
react / react-dom 18.3.1 19.2.7
@types/react 18.3.18 19.2.17
@types/react-dom 18.3.5 19.2.3

Ecosystem floors (minimum versions that peer-support React 19)

Package From To Reason
react-redux 9.0.4 9.3.0 peer widened to ^18 || ^19 at 9.2.0
react-i18next 14.0.0 15.7.4 React 19 <Trans> fixes (i18next core unchanged)
react-hook-form 7.49.2 7.80.0 peer ^19 added at 7.51
react-virtuoso 4.6.2 4.18.10 4.6.2 peer capped at React 18
@testing-library/react 14.3.1 16.3.2 React 19 requires RTL 16
@testing-library/dom 9.3.4 10.4.0 now an explicit peer of RTL 16

No change needed: redux, react-keyed-flatten-children, @testing-library/user-event, @testing-library/jest-dom, i18next core. @kayahr/jest-electron-runner is React-agnostic — its patch is untouched.

Source migration (minimal — 15 files)

The codebase was already React-19-ready in structure: all roots use createRoot, no defaultProps/propTypes/string-refs/legacy-context/react-test-renderer/findDOMNode. The only changes are type-level, driven by @types/react 19:

  • types-react-codemod preset-19 (13 files): useRef<T>()useRef<T>(undefined), RefObject<T>RefObject<T | null>, ReactElementReactElement<any>.
  • AddServerView: FormEvent<HTMLFormElement>SubmitEvent<HTMLElement> — matches what Fuselage Box's onSubmit now declares under React 19 (Box extends AllHTMLAttributes<HTMLElement>).
  • ServerButton: explicit DragEvent annotation on the onDragOver handler (React 19 no longer infers the param there); matches the sibling drag handlers.

No any casts or @ts-ignore were introduced.

Verification

  • yarn lint — ESLint + tsc clean across the tree (against @types/react 19).
  • yarn build — rollup bundles main + renderer + preload; all React 19 + Fuselage 0.80 imports resolve.
  • yarn test921 passed / 2 skipped / 53 suites. RTL 16.3.2 + React 19.2.7 render under @kayahr/jest-electron-runner. No act() deprecation warnings.
  • Fuselage conformance gate — type + companion gates green; React bump did not regress design-system usage.

Reviewer notes

  • Runtime error handling — React 19 no longer re-throws uncaught render errors to window by default (caught errors fire error boundaries / onUncaughtError). If any global window.onerror logging relied on the old rethrow, confirm it still captures. Worth a manual yarn start smoke of the renderer console.
  • No installer build needed to validate (renderer build + tests cover the change), so no build-artifacts label.

Summary by CodeRabbit

  • Bug Fixes

    • Upgraded React ecosystem dependencies to newer React 19-era versions for improved UI compatibility and stability.
    • Refined TypeScript ref and event handling across dialogs, modals, and dropdown/tooltip interactions to reduce type-related issues without changing visible behavior.
  • Chores

    • Updated React/related package versions and TypeScript React typings.
    • Adjusted test helper typings to align with the updated React ecosystem.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ffbd95bd-d2c9-439f-95d2-0407805e4e50

📥 Commits

Reviewing files that changed from the base of the PR and between dcd7778 and a1bde8f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (16)
  • package.json
  • src/ui/components/AboutDialog/index.tsx
  • src/ui/components/AddServerView/index.tsx
  • src/ui/components/Dialog/hooks.ts
  • src/ui/components/Modal/ModalBackdrop.tsx
  • src/ui/components/OutlookCredentialsDialog/index.tsx
  • src/ui/components/SelectClientCertificateDialog/index.tsx
  • src/ui/components/SideBar/ServerButton.tsx
  • src/ui/components/SideBar/ServerInfoDropdown.tsx
  • src/ui/components/SideBar/TooltipComponent.tsx
  • src/ui/components/SideBar/useDropdownVisibility.tsx
  • src/ui/components/utils/ReparentingContainer.tsx
  • src/ui/components/utils/TooltipComponent.tsx
  • src/ui/components/utils/TooltipContext.tsx
  • src/ui/components/utils/TooltipProvider.tsx
  • src/ui/test-utils.tsx
✅ Files skipped from review due to trivial changes (9)
  • src/ui/components/Dialog/hooks.ts
  • src/ui/components/utils/TooltipProvider.tsx
  • src/ui/components/utils/ReparentingContainer.tsx
  • src/ui/components/SideBar/TooltipComponent.tsx
  • src/ui/components/AddServerView/index.tsx
  • src/ui/components/SideBar/ServerInfoDropdown.tsx
  • src/ui/components/Modal/ModalBackdrop.tsx
  • src/ui/components/utils/TooltipComponent.tsx
  • src/ui/components/AboutDialog/index.tsx
🚧 Files skipped from review as they are similar to previous changes (6)
  • src/ui/test-utils.tsx
  • src/ui/components/SideBar/useDropdownVisibility.tsx
  • src/ui/components/utils/TooltipContext.tsx
  • src/ui/components/SideBar/ServerButton.tsx
  • src/ui/components/OutlookCredentialsDialog/index.tsx
  • src/ui/components/SelectClientCertificateDialog/index.tsx
📜 Recent review details
🔇 Additional comments (2)
package.json (2)

87-87: Re-check the unresolved react-keyed-flatten-children/react-is skew.

This duplicates the earlier review note: ~3.0.0 can keep the old React-18-era react-is path, while the current package README says React 19 users should install matching react-is@19, and newer react-keyed-flatten-children 5.x releases are available. (app.unpkg.com) (socket.dev)

#!/bin/bash
set -euo pipefail

python - <<'PY'
import json
from pathlib import Path

pkg = json.loads(Path("package.json").read_text())
deps = {**pkg.get("dependencies", {}), **pkg.get("devDependencies", {})}
for name in ["react", "react-is", "react-keyed-flatten-children"]:
    print(f"{name}: {deps.get(name, '<missing>')}")
PY

echo
curl -fsSL https://registry.npmjs.org/react-keyed-flatten-children/latest | jq '{version, peerDependencies, dependencies}'

9-9: LGTM!

Also applies to: 63-64, 83-86, 88-89, 114-125, 156-157


Walkthrough

React and related ecosystem packages are upgraded to React 19-compatible versions, and TypeScript ref, event, and component return types are adjusted across UI components to match the newer typings.

Changes

React 19 Upgrade

Layer / File(s) Summary
Dependency version bumps
package.json
React, React DOM, form, i18n, Redux, virtualization, and React type packages are updated to React 19-era versions.
Ref and hook initialization updates
src/ui/components/AboutDialog/index.tsx, src/ui/components/Dialog/hooks.ts, src/ui/components/Modal/ModalBackdrop.tsx, src/ui/components/OutlookCredentialsDialog/index.tsx, src/ui/components/SelectClientCertificateDialog/index.tsx, src/ui/components/SideBar/ServerInfoDropdown.tsx, src/ui/components/SideBar/useDropdownVisibility.tsx, src/ui/components/utils/TooltipProvider.tsx
Nullable refs and explicit undefined ref initialization are applied to dialog, dropdown, modal, and tooltip code paths.
Type signature updates
src/ui/components/AddServerView/index.tsx, src/ui/components/Modal/ModalBackdrop.tsx, src/ui/components/OutlookCredentialsDialog/index.tsx, src/ui/components/SideBar/ServerButton.tsx, src/ui/components/SideBar/TooltipComponent.tsx, src/ui/components/utils/ReparentingContainer.tsx, src/ui/components/utils/TooltipComponent.tsx, src/ui/components/utils/TooltipContext.tsx, src/ui/test-utils.tsx
Form, drag, tooltip, and test helper signatures switch to React 19-compatible event and element types.

Estimated code review effort: 2 (Simple) | ~12 minutes

Possibly related PRs

Suggested labels: type: chore

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: upgrading React from 18.3 to 19.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.

Warning

Review ran into problems

🔥 Problems

Errors were encountered while retrieving linked issues.

Errors (4)
  • CORE-2398: Request failed with status code 401
  • FUSELAGE-080: Request failed with status code 401
  • REACT-19: Request failed with status code 401
  • PRESET-19: Request failed with status code 401

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/ui/components/SideBar/ServerButton.tsx (1)

170-170: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Use React.DragEvent in ServerButton.tsx
DragEvent here is the DOM type, but React passes a synthetic drag event to onDragOver. Use React.DragEvent<HTMLElement> or let it infer the type so the handler stays consistent with the other drag callbacks and doesn’t mask type errors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/ui/components/SideBar/ServerButton.tsx` at line 170, The onDragOver
handler in ServerButton should not use the DOM DragEvent type, since React
provides a synthetic drag event. Update the handler signature in ServerButton to
use React.DragEvent<HTMLElement> or remove the explicit annotation so it aligns
with the other drag callbacks and preserves proper type checking.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/ui/components/SideBar/ServerButton.tsx`:
- Line 170: The onDragOver handler in ServerButton should not use the DOM
DragEvent type, since React provides a synthetic drag event. Update the handler
signature in ServerButton to use React.DragEvent<HTMLElement> or remove the
explicit annotation so it aligns with the other drag callbacks and preserves
proper type checking.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dfc01185-36bd-41d8-b393-525a31d6d26b

📥 Commits

Reviewing files that changed from the base of the PR and between d111866 and dcd7778.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (16)
  • package.json
  • src/ui/components/AboutDialog/index.tsx
  • src/ui/components/AddServerView/index.tsx
  • src/ui/components/Dialog/hooks.ts
  • src/ui/components/Modal/ModalBackdrop.tsx
  • src/ui/components/OutlookCredentialsDialog/index.tsx
  • src/ui/components/SelectClientCertificateDialog/index.tsx
  • src/ui/components/SideBar/ServerButton.tsx
  • src/ui/components/SideBar/ServerInfoDropdown.tsx
  • src/ui/components/SideBar/TooltipComponent.tsx
  • src/ui/components/SideBar/useDropdownVisibility.tsx
  • src/ui/components/utils/ReparentingContainer.tsx
  • src/ui/components/utils/TooltipComponent.tsx
  • src/ui/components/utils/TooltipContext.tsx
  • src/ui/components/utils/TooltipProvider.tsx
  • src/ui/test-utils.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{tsx,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{tsx,ts}: MANDATORY: Use Fuselage components for all UI work. Only create custom components when Fuselage doesn't provide what's needed
Import UI components from @rocket.chat/fuselage and check Theme.d.ts for valid color tokens
Use React functional components with hooks
Use PascalCase for component file names

Files:

  • src/ui/components/SideBar/useDropdownVisibility.tsx
  • src/ui/components/utils/TooltipComponent.tsx
  • src/ui/components/utils/ReparentingContainer.tsx
  • src/ui/components/SideBar/ServerButton.tsx
  • src/ui/components/SideBar/TooltipComponent.tsx
  • src/ui/components/SelectClientCertificateDialog/index.tsx
  • src/ui/components/utils/TooltipContext.tsx
  • src/ui/components/OutlookCredentialsDialog/index.tsx
  • src/ui/components/SideBar/ServerInfoDropdown.tsx
  • src/ui/components/AboutDialog/index.tsx
  • src/ui/components/AddServerView/index.tsx
  • src/ui/components/Dialog/hooks.ts
  • src/ui/components/utils/TooltipProvider.tsx
  • src/ui/test-utils.tsx
  • src/ui/components/Modal/ModalBackdrop.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{ts,tsx}: Redux actions must follow FSA (Flux Standard Action) pattern
Avoid unnecessary comments — write self-documenting code through clear naming
Always verify libraries by checking official docs and .d.ts files in node_modules/. Never assume props, tokens, or APIs work without verification
Avoid subjective descriptors ('smart', 'excellent', 'dumb') in documentation and comments
Use measurable descriptions in code documentation: 'reduced memory usage', 'improved by X%' instead of subjective claims
NEVER invent metrics — don't include estimated time spent or speculated user counts. Only include numbers from actual logs, error messages, or documented sources

Files:

  • src/ui/components/SideBar/useDropdownVisibility.tsx
  • src/ui/components/utils/TooltipComponent.tsx
  • src/ui/components/utils/ReparentingContainer.tsx
  • src/ui/components/SideBar/ServerButton.tsx
  • src/ui/components/SideBar/TooltipComponent.tsx
  • src/ui/components/SelectClientCertificateDialog/index.tsx
  • src/ui/components/utils/TooltipContext.tsx
  • src/ui/components/OutlookCredentialsDialog/index.tsx
  • src/ui/components/SideBar/ServerInfoDropdown.tsx
  • src/ui/components/AboutDialog/index.tsx
  • src/ui/components/AddServerView/index.tsx
  • src/ui/components/Dialog/hooks.ts
  • src/ui/components/utils/TooltipProvider.tsx
  • src/ui/test-utils.tsx
  • src/ui/components/Modal/ModalBackdrop.tsx
**/*.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.ts: Use TypeScript for all new code unless explicitly told otherwise
Use optional chaining with fallbacks for platform-specific APIs instead of mocking when possible. Example: const uid = process.getuid?.() ?? 1000;

Files:

  • src/ui/components/Dialog/hooks.ts
🔇 Additional comments (17)
src/ui/components/Dialog/hooks.ts (1)

9-9: LGTM!

src/ui/components/AboutDialog/index.tsx (1)

249-249: LGTM!

src/ui/components/Modal/ModalBackdrop.tsx (1)

26-26: LGTM!

Also applies to: 35-35, 87-87

src/ui/components/SideBar/ServerInfoDropdown.tsx (1)

8-9: LGTM!

src/ui/components/SideBar/useDropdownVisibility.tsx (1)

21-22: LGTM!

src/ui/test-utils.tsx (1)

37-37: LGTM!

package.json (1)

83-89: 🔒 Security & Privacy

Confirm React 19 peer support for the remaining packages
react/react-dom are aligned at 19.2.7, and react-redux@9.3.0 plus @testing-library/react@16.3.2 already include React 19 in their peer ranges. react-hook-form@7.80.0, react-i18next@15.7.4, and react-virtuoso@4.18.10 still need an explicit registry/docs check before this bump is treated as safe.

src/ui/components/AddServerView/index.tsx (2)

15-15: LGTM!


116-116: LGTM!

src/ui/components/OutlookCredentialsDialog/index.tsx (2)

48-48: LGTM!


177-179: LGTM!

src/ui/components/SelectClientCertificateDialog/index.tsx (1)

27-27: LGTM!

src/ui/components/utils/TooltipProvider.tsx (1)

14-14: LGTM!

src/ui/components/SideBar/TooltipComponent.tsx (1)

17-17: LGTM!

src/ui/components/utils/ReparentingContainer.tsx (1)

17-19: LGTM!

src/ui/components/utils/TooltipComponent.tsx (1)

17-17: LGTM!

src/ui/components/utils/TooltipContext.tsx (1)

4-4: LGTM!

Comment thread package.json
"react-dom": "~19.2.7",
"react-hook-form": "~7.80.0",
"react-i18next": "~15.7.4",
"react-keyed-flatten-children": "~3.0.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

react-is is now a peer dependency of react-keyed-flatted-children but it's not listed here. react-keyed-flatted-children itself might be upgraded to 5.x for compatibility with the latest @rocket.chat/fuselage.

Base automatically changed from chore/fuselage-080 to master July 8, 2026 18:17
Core: react/react-dom 18.3.1→19.2.7, @types/react 18.3→19.2.17,
@types/react-dom 18.3→19.2.3.

Ecosystem floors for React 19 peer support:
- react-redux 9.0.4→9.3.0
- react-i18next 14.0.0→15.7.4
- react-hook-form 7.49.2→7.80.0
- react-virtuoso 4.6.2→4.18.10
- @testing-library/react 14.3.1→16.3.2 (+ @testing-library/dom →10.4.0)

Source migration (minimal — 15 files):
- types-react-codemod preset-19: useRef<T>() → useRef<T>(undefined),
  RefObject<T> → RefObject<T|null>, ReactElement → ReactElement<any> (13 files)
- AddServerView: FormEvent<HTMLFormElement> → SubmitEvent<HTMLElement>
  (matches Fuselage Box onSubmit under React 19 types)
- ServerButton: explicit DragEvent annotation on onDragOver handler

Verified: tsc + eslint clean, rollup build resolves all imports,
921 tests pass (RTL 16 + React 19 under jest-electron-runner, no act()
warnings), fuselage-gate type+companion green.

Stacks on #3383 (fuselage 0.80, which ships React 19 peer support).
@jeanfbrito
jeanfbrito merged commit a16dfd6 into master Jul 8, 2026
9 checks passed
@jeanfbrito
jeanfbrito deleted the chore/react-19 branch July 8, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants