feat: support React 19 - #39
Merged
Merged
Conversation
- Widen react / react-dom / react-is peer ranges to include ^19.0.0 - Replace global `JSX.Element` references with `React.ReactElement` in the hand-written index.d.ts, the committed types/ build artifacts, and src/layers/src/Pane.tsx. React 19's typings removed the global JSX namespace, so these references stopped resolving (degrading the affected types to `any`) for consumers on @types/react 19. `React.ReactElement` is equivalent here and resolves under @types/react 17, 18, and 19, so the package keeps working with the repo's current toolchain. Runtime is already React 19-compatible: every react-transition-group usage (Overlay, Positioner, Toast, CornerDialog) passes nodeRef, so the removed findDOMNode fallback is never hit.
react-dom 19 no longer exports render, so the catch branch in the
createRoot path would crash with 'undefined is not a function' in
environments where require('react-dom/client') throws (e.g. native ESM
consuming the esm build). Only fall back when render actually exists;
otherwise surface the original error.
Requires the ui-box release containing the React 19 `Box.defaultProps` fix (adtribute/mqa-ui-box#29) so consumers can't resolve 5.7.0, which loses box-sizing: border-box under React 19.
Contributor
Author
|
Blocked by adtribute/mqa-ui-box#29. This branch pins Order of operations:
|
ui-box 5.8.0's React.JSX typings make the Box spread type-check, so the suppression itself became a TS2578 build error.
…ment` tsc infers the global JSX.Element for JSX-returning .js sources, which no longer resolves under @types/react 19. Explicit @returns annotations make yarn build-types emit React.ReactElement, so the committed types/ artifacts stop regressing on every rebuild.
Lockfile picks up the published 5.8.0 (React 19 Box.defaultProps fix); commonjs/, esm/, and types/ rebuilt from the updated source.
ui-box 5.8.0 uses React.JSX.*, which doesn't exist in @types/react 17 (the lockfile's previous resolution for @types/react@*). Under skipLibCheck the Box types silently degraded to any in this repo's own toolchain — tsd's expectError assertions stopped erroring (CI failure) and Pane's @ts-expect-error looked stale (restored here). Pinning the resolution to ^18.3.0 matches the dev react 18.2 and makes the types real again; commonjs/esm/types rebuilt with the 18 emissions.
Type _Pane against the concrete 'div' default instead of an open generic. TS can't prove assignability of spread props into Box's polymorphic props for an unresolved type parameter (deferred LibraryManagedAttributes), which is all the suppression was hiding. The public polymorphic signature is unchanged — it was already applied by the cast on the memo(forwardRef(...)) export, and the emitted types/layers/src/Pane.d.ts is byte-identical.
Contributor
Author
|
Unblocked — |
harrisonhunter
approved these changes
Jun 13, 2026
Merged
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.
Summary
react/react-dom/react-ispeer ranges to include^19.0.0JSX.ElementwithReact.ReactElementinindex.d.tsand the committedtypes/artifacts; add JSDoc@returnsannotations soyarn build-typesemitsReact.ReactElementpermanently instead of regressing on rebuild (React 19 upgrade guide: The JSX namespace in TypeScript)Toasteragainst the removedReactDOM.render— the fallback only runs where it exists; otherwise the originalreact-dom/clienterror surfaces (React 19 upgrade guide: Removed ReactDOM.render)@maestroqa/ui-boxto^5.8.0(React 19Box.defaultPropsfix, feat: support React 19 mqa-ui-box#29) and rebuildcommonjs//esm//types/(React 19 upgrade guide: Removed propTypes and defaultProps)@types/reactto^18.3.0via resolutions so ui-box 5.8.0'sReact.JSXtypings resolve in this repo's toolchain (under @types/react 17 they silently degrade toany, defeating tsd — this is what the earlier CI failure was)_Paneagainst the concrete'div'default, removing the@ts-expect-erroron the Box spread; public signature and emittedPane.d.tsunchangedNote:
types/layers/src/Pane.d.tsreferencesReact.JSX.IntrinsicElements, raising the floor for typed consumers to@types/react≥ 18.2.21.Validation
Tested end-to-end in the analytics app on React 19.2.7 (branch consuming this PR's head by git SHA, with the app's global-JSX shim and peer-rule workarounds removed):
lint:typespasses; strict-mode failures are pre-existing app issues, none referencing evergreen/ui-boxnodeRef/findDOMNodepath), Tooltips, and Toaster (React 19createRootpath) all work with zero console errorsbox-sizing: border-box, confirming the ui-box 5.8.0defaultPropsfix end-to-endRelease
After merge:
npm version minor(→ 7.7.0) andgit push --tags.