Skip to content

feat: add React 19 support#1750

Draft
HendrikThePendric wants to merge 4 commits into
masterfrom
feat/add-react-19-support
Draft

feat: add React 19 support#1750
HendrikThePendric wants to merge 4 commits into
masterfrom
feat/add-react-19-support

Conversation

@HendrikThePendric

@HendrikThePendric HendrikThePendric commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Implements N/A — prompted by a Dependabot PR


Description

Adds React 19 to peer ranges across all packages, keeping React 16/18 support. No public API changes.

  • Peer ranges widened to "^16.13 || ^18 || ^19" in 49 package.json files.
  • Dropped the react-popper dependency and kept a local copy of its usePopper hook in @dhis2-ui/popper. react-popper is no longer maintained (archived Dec 2024) and never added React 19 support. The local copy uses @popperjs/core directly — same as react-popper did. Runtime behavior is unchanged.
  • Ref types in popper/popover/tooltip/intersection-detector widened to accept React 19's RefObject<T | null>. Compatible with @types/react 16, 18, and 19.
  • Testing-library devDependencies bumped to versions declaring React 19 peer support.

Checklist

  • API docs are generated N/A
  • Tests were added
    • ⚠️ TO DO: Run tests against React 19 (and 18 and 16.8+ -- make a test matrix)
  • Storybook demos were added N/A

Screenshots

No visual changes.

Add React 19 to react/react-dom peer ranges across all packages while
keeping React 16/18 fully supported. Backwards-compatible: no public API
breaks.

- Widen peer ranges to "^16.13 || ^18 || ^19" in 49 package.json files
- Inline usePopper into @dhis2-ui/popper to drop react-popper (archived
  Dec 2024, never updated for React 19). Runtime is unchanged — the hook
  uses @popperjs/core directly.
- Widen ref types in popper/popover/tooltip/intersection-detector .d.ts
  so consumers' useRef<T>(null) → RefObject<T | null> (the React 19 shape)
  type-checks. Verified compatible under @types/react 16, 18, and 19.
- Bump @testing-library/react, jest-dom, user-event to versions declaring
  React 19 peer support (devDeps only — does not affect consumers).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dhis2-bot

dhis2-bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-1750--dhis2-ui.netlify.app

@dhis2-bot dhis2-bot temporarily deployed to netlify June 18, 2026 10:48 Inactive
HendrikThePendric and others added 2 commits June 18, 2026 13:51
- Flip negated condition to positive form and use globalThis.window
- Hoist style/attribute mapping out of flushSync to keep callback nesting
  within the 4-level limit

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Reorder use-popper.js import after modifiers.js in popper.js
- Declare globalThis as a global in use-popper.js
- Drop unused eslint-disable directive

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dhis2-bot dhis2-bot temporarily deployed to netlify June 18, 2026 11:57 Inactive
Addresses SonarCloud rule S7741.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@dhis2-bot dhis2-bot temporarily deployed to netlify June 18, 2026 12:01 Inactive
@HendrikThePendric HendrikThePendric marked this pull request as ready for review June 23, 2026 07:11
@HendrikThePendric HendrikThePendric requested a review from a team as a code owner June 23, 2026 07:11
@KaiVandivier KaiVandivier marked this pull request as draft June 23, 2026 13:56
@HendrikThePendric

Copy link
Copy Markdown
Contributor Author

This PR will get merged once we add React v19 support to App Platform as a whole. This may or may not coincide with releasing a next major version, in which case we should first merge #1751 into this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants