Won't Fix
Last Updated: 05 Sep 2019 16:58 by ADMIN
Eric
Created on: 16 Aug 2019 06:19
Category: UI for Blazor
Type: Bug Report
1
Using RenderStaticComponentAsync breaks Telerik components

You may get an exception like

InvalidOperationException: The current thread is not associated with the Dispatcher. Use Invoke() or InvokeAsync() to switch execution to the Dispatcher when triggering rendering or modifying any state accessed during rendering.

or you may get components that simply don't work (for example, a Window does not show, a treeview does not expand).

The solution is to revert to the RenderComponentAsync method in your _Hosts.cshtml file.

3 comments
ADMIN
Marin Bratanov
Posted on: 05 Sep 2019 16:58

A third update - With Preview 9 things changed again, including the default template and the method used in the <app> element.

With 1.7.0 and Preview 9 the Telerik components also work with PreRendering:

 

    <app>
        @(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))
    </app>

 

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
ADMIN
Marin Bratanov
Posted on: 22 Aug 2019 05:40
A second update - it seems that the non-static version of the method may still attempt to do pre-rendering in Preview 8 (and thus call lifecycle events twice - see this issue that is closed but not fixed - the "fix" will be that pre-rendering will go away), so if you experience issues with the Telerik controls, remove the entire contents of the <app></app> element in your Server Blazor app, including the call to RenderComponentAsync.

Regards,
Marin Bratanov
Progress Telerik UI for Blazor
ADMIN
Marin Bratanov
Posted on: 16 Aug 2019 13:05
Hi,

It seems that the "static" flavor of the method will be removed in Preview 9 along with pre-rendering (https://github.com/aspnet/AspNetCore/issues/12245), so this is not something that we will be fixing.


Regards,
Marin Bratanov
Progress Telerik UI for Blazor