Skip to content

feat: support React 19 in peerDependencies#393

Merged
korvin89 merged 1 commit into
mainfrom
feat/react-19-peers
Jun 5, 2026
Merged

feat: support React 19 in peerDependencies#393
korvin89 merged 1 commit into
mainfrom
feat/react-19-peers

Conversation

@korvin89
Copy link
Copy Markdown
Contributor

@korvin89 korvin89 commented Jun 5, 2026

Summary

  • Extend react / react-dom peerDependencies with ^19.0.0 (keeping 16/17/18).
  • Widen ref typings (RefObject<T>RefObject<T | null>) in public and internal types so consumers on @types/react@19 get clean type-checking — useRef<T>(null) returns RefObject<T | null> in v19. Backward-compatible with @types/react@18 (covariant assignment).
  • Replace JSX.Element with React.ReactElement in Notifications public types — @types/react@19 removed the global JSX namespace.
  • Two tiny casts (Gallery's native <button ref> and TokenizedInput Wrapper's native <div ref>) needed for @types/react@18 LegacyRef<T> variance — commented inline.
  • No runtime behavior changes.

devDependencies are intentionally not bumped — react / react-dom / @types/react / @types/react-dom stay on ^18, matching the approach used in @gravity-ui/uikit. The library is verified against React 19 ad-hoc (see test plan); the dev stack continues to develop and test against React 18.

- Extend react/react-dom peers with ^19.0.0
- Widen RefObject<T> to RefObject<T | null> in public/internal ref typings
  for compatibility with @types/react@19
- Replace JSX.Element with React.ReactElement in public types
@gravity-ui-bot
Copy link
Copy Markdown
Contributor

Preview is ready.

@korvin89 korvin89 merged commit b3bb63e into main Jun 5, 2026
4 checks passed
@korvin89 korvin89 deleted the feat/react-19-peers branch June 5, 2026 13:09
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.

3 participants