Skip to content

fix(react): avoid React 19 element ref warning#1815

Merged
mihar-22 merged 1 commit into
mainfrom
codex/1775-react-slot-ref
May 26, 2026
Merged

fix(react): avoid React 19 element ref warning#1815
mihar-22 merged 1 commit into
mainfrom
codex/1775-react-slot-ref

Conversation

@mihar-22
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 commented May 26, 2026

Summary

  • Adds a React 18/19-compatible helper for reading a child element ref without triggering development deprecation warnings.
  • Keeps the existing SlotClone ref composition behavior unchanged.
  • Avoids passing refs to React.Fragment, matching Radix Slot’s current React 19 compatibility guard.

Validation

  • pnpm --filter @vidstack/react typecheck
  • pnpm exec oxfmt --check packages/react/src/components/primitives/slot.tsx

Fixes #1775.
references #1608.

@mihar-22 mihar-22 force-pushed the codex/1775-react-slot-ref branch from 0866e13 to 238063b Compare May 26, 2026 06:55
@mihar-22 mihar-22 marked this pull request as ready for review May 26, 2026 07:06
@mihar-22 mihar-22 merged commit faf718f into main May 26, 2026
1 check passed
@mihar-22 mihar-22 deleted the codex/1775-react-slot-ref branch May 26, 2026 07:06
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.

React 19 - element.ref deprecation - update Slot implementation

1 participant