Skip to content

fix(slot): Render nothing when no outlet is registered - #112568

Merged
JonasBa merged 1 commit into
jb/cmdk/jsx-pocfrom
jb/fix/slot-outlet-null
Apr 9, 2026
Merged

JonasBa merged 1 commit into
jb/cmdk/jsx-pocfrom
jb/fix/slot-outlet-null

Conversation

@JonasBa

@JonasBa JonasBa commented Apr 9, 2026 •

Copy link
Copy Markdown
Contributor

Render slot consumer content only after an outlet element is available.

Previously the slot consumer rendered its children in place until the outlet mounted, then switched over to a portal. That caused a flash of content at the wrong DOM position and changed the rendered element type under React, which reset component identity across outlet lifecycle changes.

This makes the consumer return null until the outlet is ready and updates the slot tests to match that behavior.

Refs GH-112564

Stop rendering slot consumer content in place when no outlet element is available. This avoids the initial flash at the wrong DOM position and prevents remounts caused by switching from inline rendering to a portal once the outlet appears.

Co-Authored-By: OpenAI Codex <noreply@openai.com>
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 9, 2026
@JonasBa
JonasBa marked this pull request as ready for review April 9, 2026 09:13
@JonasBa
JonasBa requested a review from a team as a code owner April 9, 2026 09:13
@JonasBa
JonasBa merged commit 7508757 into jb/cmdk/jsx-poc Apr 9, 2026
62 of 63 checks passed
@JonasBa
JonasBa deleted the jb/fix/slot-outlet-null branch April 9, 2026 09:23
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 24, 2026

This branch was successfully deployed

1 active deployment
Preview — 68b02895 Deployed Apr 9, 2026 by vercel[bot]
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants