Router displays NotFoundContent without any layout #10445
Labels
area-blazor
Includes: Blazor, Razor Components
Done
This issue has been fixed
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
Milestone
Since we changed
Router
to have aNotFoundContent
fragment instead of referencing a "fallback page" type, we've lost the convenience of having the content rendered inside a layout. It just renders very plainly (typically, black Times New Roman on a white screen).This might not seem super important for the "not found" message, but we're also about to add "authorizing..." and "not authorized" content here too, and those really should be rendered inside a layout or the app will look flickery and weird as it jumps between displays styles.
Possible solution:
DefaultLayout
property toRouter
(of typeSystem.Type
, just like we used to forFallbackComponent
).<Router ... DefaultLayout="typeof(MainLayout)">
DefaultLayout
property to theLayoutDisplay
component, and haveRouter
automatically pass the value throughLayoutDisplay
so that, when the target doesn't define any layout, we use theDefaultLayout
typeLayoutDisplay
able to receive aRenderFragment
as an alternative to a page type, i.e., it supports either. ThenRouter
can render itsNotFoundContent
by passing the render fragment toLayoutDisplay
The text was updated successfully, but these errors were encountered: