MediaQueryList not working in layout but worked in a certain page #99
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
more info needed
Further information is requested about the problem statement
Hi Ed, I'm creating a Blazor Web App using Interactive SSR and Per page / component rendering. I want my home page different from other pages so I created another Layout and uses the two layouts in my app.
But when I place the
MediaQueryList
in any one or both the layout file, it just throws an exception sayingMediaQueryList
is null and doesn't work. I tried theApp.razor
file and evenRoutes.razor
, too.Magically, when I tried to put it right in the only page I'm using media queries, it magically worked. The code is below:
PS: due to the per page / component rendering,
@rendermode
is neededThe problem appears, and disappears, but I don't know why... Since I've tried to use media query like this (put
MediaQueryList
andMediaQuery
in one file) in other pages, and it works well, I was wondering ifMediaQuery
works as long as they're wrapped by aMediaQueryList
?Is there any possible consequences like memory leaking or something?
The text was updated successfully, but these errors were encountered: