-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
Milestone
Description
MVC & Razor Pages have an environment tag helper for rendering content based on the current environment. In Blazor, you have to inject either the IHostEnvironment
or IWebAssemblyHostEnvironment
services and then write conditional rendering logic. This is tricky to do correctly for components that run on WebAssembly and are prerendered because you don't have a common why to get the environment that works for server and client. We have complicated explanations in the Blazor docs on how to handle this. We should consider just adding an Environment component, similar to the environment tag helper, that makes it easy to render content based on the current environment.
boukenka and rogihee