Description
The App.razor component always renders statically. One implication is that any services included via @inject directives in _Imports.razor will be created more than once if App.razor's children contain a different render mode.
Everything I've seen about render modes up until now talked about how services would be created more than once if pre-rendering was enabled (once for pre-render and once for the regular render). So, the first paragraph above was unexpected.
ref: dotnet/aspnetcore#53804 (comment)
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/render-modes.md
Document ID
7c9948a3-9886-8097-6014-492a4c21ea4e
Article author
@guardrex
Description
The App.razor component always renders statically. One implication is that any services included via
@injectdirectives in _Imports.razor will be created more than once if App.razor's children contain a different render mode.Everything I've seen about render modes up until now talked about how services would be created more than once if pre-rendering was enabled (once for pre-render and once for the regular render). So, the first paragraph above was unexpected.
ref: dotnet/aspnetcore#53804 (comment)
Page URL
https://learn.microsoft.com/en-us/aspnet/core/blazor/components/render-modes?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/components/render-modes.md
Document ID
7c9948a3-9886-8097-6014-492a4c21ea4e
Article author
@guardrex