Skip to content

Conversation

@guardrex
Copy link
Collaborator

@guardrex guardrex commented Dec 12, 2025

Fixes #36487


Internal previews

📄 File 🔗 Preview link
aspnetcore/blazor/components/index.md aspnetcore/blazor/components/index

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #36487 by adding documentation on how to return multiple elements from a Razor delegate in Blazor components. The documentation explains the use of the <text> tag for explicit delimited transitions when multiple elements need to be returned from a RenderFragment.

Key Changes:

  • Added explanatory text describing the use of <text> tags with Razor delegates
  • Included a practical code example demonstrating the technique
  • Provided a cross-reference to the Razor syntax documentation for explicit delimited transitions

@guardrex guardrex requested a review from maraf December 12, 2025 14:14
@maraf
Copy link
Member

maraf commented Dec 15, 2025

It's relevant also if you're returning a statement. Basically anything that is not a single root html element

return @if(...)
{
}
;

@guardrex
Copy link
Collaborator Author

@maraf ... I'm not familiar with that syntax, and I can't get something like that to compile. If you want to show an example of that, can you provide a fully working RenderFragment method?

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.

Cross-link the *Explicit delimited transition* section

3 participants