-
Notifications
You must be signed in to change notification settings - Fork 810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET8 render modes break RadzenComponents #1193
Comments
Duplicate of #1183. Check the linked forum thread for explanation and workarounds. This thread also shows how to use
|
Decided to pin this issue as I suspect this question will be asked a lot. Here is the situation with Blazor 8 rendering modes and Blazor UI components (Radzen.Blazor or any other library or built-in component). The default Blazor 8 web application template uses static rendering mode by default. In static mode events are not fired and components can't handle them. This is by Microsoft design and will not change. This is why components added to MainLayout.razor (or any other component with static render mode) won't appear to work - they will not respond to user interaction. One cannot set a render mode for a layout (also by design) - it has to be enabled up the hierarchy for example for the A workaround is to specify the render mode per component e.g. If you want to have interactive "island" in a static page you have to define a component which has the render mode set via attribute:
There are Radzen.Blazor components that don't use events and do not require any non-static render mode - RadzenCard, RadzenRow, RadzenStack, RadzenBadge and a few others. For additional info check these threads: https://forum.radzen.com/t/sidebar-not-working-in-net-8-rc1-experiment/15198/13 |
Describe the bug
.NET8 new render modes break RadzenComponents
To Reproduce
-Create a Blazor Server App with .NET8 RC2
-Add the required js, css and services
-Add RadzenComponents to the main layout
Expected behavior
DialogService.Open should work in components with RenderModeInteractiveServer.
Actual behavior
DialogService.Open does not work, nothing happens.
This is issue, from my understanding that layouts are rendered as static components, therefore the RadzenComponents in the layout will not be accessible from any interactive component further down. It appears to be impossible to set the rendermode for a specific layout (dotnet/aspnetcore#50518).
I have found only two ways to get RadzenComponents to work with .NET8
With the second method you effectively lose the ability to use SSR, which can be problematic if you plan to use the new Blazor Identity Components, which do not work in interactive mode.
I don't think there is a way to make a specific component static so once the route is set to interactive any component or page will also be interactive.
Am I missing something?
What is the recommended way to add RadzenComponents with NET8?
The text was updated successfully, but these errors were encountered: