yoshiki-okawa / BlazorJSProxy

Dynamic proxy of Microsoft.JSInterop.IJSRuntime which makes defining and invoking JS object much easier
MIT License
2 stars 0 forks source link

Support for Blazor Server #2

Open nickj886 opened 2 years ago

nickj886 commented 2 years ago

Hi,

Does the BlazorJSProxy work with Blazor Server or just Webassembly?

Thanks Nick

yoshiki-okawa commented 2 years ago

Possibly works but not in initial prerendering:

For Blazor Server apps with prerendering enabled, calling into JS isn't possible during initial prerendering. JS interop calls must be deferred until after the connection with the browser is established.

https://docs.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-6.0 https://docs.microsoft.com/en-us/aspnet/core/blazor/javascript-interoperability/call-javascript-from-dotnet?view=aspnetcore-6.0#detect-when-a-blazor-server-app-is-prerendering