Blazor 8 comes with a feature "Enhanced navigation" which basically intercepts navigation using anchor elements and instead of a full page load, issues a fetch request with subsequent DOM diff/patch.
Blazor supports registering an event listener for that scenario which I have currently implemented as follows:
Blazor.addEventListener("enhancedload", () => {
KTComponents.init();
});
I'm confused. This wasn't a suggestion but a question.
Hi,
From your post, it looks like you are trying to change our Blazor initialization flow.
Currently, we trigger initialization functions from the OnAfterRender event.
Here's an example:
protected override void OnAfterRender(bool firstRender)
{
if (firstRender)
{
JS.InvokeVoidAsync("KTComponents.init");
}
}
Hi Oliver,
Thank you for the suggestion. We will check this initialization approach and consider implementing it for future releases.
In our current version, we handle Javascript initialization through JS interop.
Regards,
Lauris Stepanovs,
Keenthemes Support Team