Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
🐛 Bug Report
I'm new to Blazor and created a new .NET 9 Blazor web app with per page render mode and want to use the ToastService.
According to the documentation
<FluentToastProvider/>
should be added to MainLayout.razor with interactivity enabled.But as the MainLayout.razor file is shared between Server-side rendered page and client-side rendered pages i don't know what rendermode to set for the
<FluentToastProvider/>
Options are:
I also tried to dynamically set rendermode based on .NET9 RendererInfo.Name or AssignedRenderMode but no Luck.
The only workaround i found to include the FluentToastProvider separately on each page which leads to other problems as it might get added twice (in components), fake scrollbars and all toast are removed an page navigation (so RemoveToastsOnNavigation has no effect) . And of course its easy to forget to include.
I've the same problem with the other providers which require interactivity
So whats the correct approach here?
💻 Repro or Code Sample
My MainLayout.razor:
The either use
@rendermode RenderAt.Server
or
@rendermode RenderAt.Client
with this RenderAt class:
🤔 Expected Behavior
Providers should work with per-page rendering
😯 Current Behavior
No way to include Provider into MainLayout.razor with per-page rendering
💁 Possible Solution
🔦 Context
🌍 Your Environment
Beta Was this translation helpful? Give feedback.
All reactions