feat: add React 19 support#1750
Draft
HendrikThePendric wants to merge 4 commits into
Draft
Conversation
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>
Contributor
|
🚀 Deployed on https://pr-1750--dhis2-ui.netlify.app |
- 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>
Addresses SonarCloud rule S7741. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
3 tasks
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.
"^16.13 || ^18 || ^19"in 49 package.json files.react-popperdependency and kept a local copy of itsusePopperhook in@dhis2-ui/popper.react-popperis no longer maintained (archived Dec 2024) and never added React 19 support. The local copy uses@popperjs/coredirectly — same as react-popper did. Runtime behavior is unchanged.RefObject<T | null>. Compatible with @types/react 16, 18, and 19.Checklist
Screenshots
No visual changes.