Skip to content

In .NET8 Blazor WebApp can MainLayout.cs be interactive without a global render mode in App.razor? #51491

Answered by Aquaritek
Ghevi asked this question in Q&A
Discussion options

You must be logged in to vote

The only way to make anything that Consumes a RenderFragment interactive is to wrap the component in an interactive component to let interactivity cascade.

That said the only way to wrap MainLayout is to globally set the interactivity rendermode in the App.razor file on both the HeadOutlet component and the Routes component.

The caveat here is that you've effectively locked yourself into the rendermode permanently for all cascading components or rather the entire app.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Ghevi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area-blazor Includes: Blazor, Razor Components
2 participants