Skip to content

feat: support React 19 - #29

Merged
taochu merged 2 commits into
masterfrom
react19-upgrade
Jun 12, 2026
Merged

feat: support React 19#29
taochu merged 2 commits into
masterfrom
react19-upgrade

Conversation

@taochu

@taochu taochu commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Widen the react peer dependency range to include ^19.0.0
  • Replace global JSX namespace references with React.JSX — React 19's typings removed the global namespace (upgrade guide: The JSX namespace in TypeScript), which made BoxProps/BoxComponent silently degrade to any for consumers on @types/react 19. React.JSX resolves on @types/react 18.2.21+ (the pinned devDep is 18.3.18) and 19.
  • Remove Box.defaultProps — React 19 ignores defaultProps on function components (upgrade guide: Removed propTypes and defaultProps), which silently dropped the box-sizing: border-box default from every Box. The default is now applied inline, only when the prop is absent, mirroring React's own resolveDefaultProps order so the emitted CSS/DOM is unchanged on React 16–18 (all 88 ava tests pass with unchanged snapshots). The is: 'div' default was already redundant with the is || 'div' fallback.

Release

After merge: yarn release as 5.8.0 (publishes @maestroqa/ui-box; dist is rebuilt by prepublishOnly).

cursoragent and others added 2 commits June 11, 2026 11:36
- Widen the `react` peer dependency range to include ^19.0.0
- Replace global `JSX` namespace references with `React.JSX` — React 19's
  typings removed the global namespace, which made `BoxProps`/`BoxComponent`
  silently degrade to `any` for consumers on @types/react 19. `React.JSX`
  resolves on @types/react 18.2.21+ (the pinned devDep is 18.3.18) and 19.
React 19 ignores defaultProps on function components, which silently
dropped the box-sizing: border-box default from every Box. Apply it
inline only when absent — mirroring React's resolveDefaultProps order —
so snapshot output is byte-identical on React 16-18. The is: 'div'
default was already redundant with the is || 'div' fallback.
taochu added a commit to adtribute/mqa-evergreen that referenced this pull request Jun 11, 2026
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.
@taochu taochu added the ready for review Pull requests that are ready for review label Jun 11, 2026

@harrisonhunter harrisonhunter left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

approving proactively, not super familiar with this repo

@taochu
taochu merged commit e641292 into master Jun 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants