EdCharbeneau / BlazorSize

Blazor browser size interop for matchMedia and browser window size at runtime.
336 stars 39 forks source link

Using BlazorSize in a .NET 5 MVC Project with Blazor Components #57

Closed kenneymyers closed 3 years ago

kenneymyers commented 3 years ago

I have a project that is using MVC and Blazor that worked fine with .NET Core 3.1 but is having all kinds of problems with BlazorSize with .NET 5.0. To avoid a hot mess I took the example that you uploaded to the repo and added it to an MVC project as closely as I could to give you a minimal example.

It is my hope that you can point me to what I need to do to get BlazorSize working properly. The repo is located here https://github.com/longhornleads/BlazorsizeNet5Issue - I apologize for the delay in getting you something useful. If you can take a look it's possible that it will address some of the other JSInterop problems that others are having.

Thank you!

The repo has been removed so nobody follows that approach ha.

kenneymyers commented 3 years ago

Hey @EdCharbeneau I was able to resolve this issue by using the listener instead of the MediaQueryList. If anyone else is having a problem and wants to see that solution just let me know.