Is it possible to add a blazor component in the root index page?

Viewed 860

I am referring to this index page (wwwroot)

I am working with blazor wasm and I don't like the "Loading..." you get when you first pull up the application home page. So I am working in the index page to replace that with a spinner. This is simple enough if you just use html but I prefer to create a spinner blazor component which I would then reuse in the rest of the app. Is this possible?

i.e.

<app><MyLoadingComponent/></app>

I would understand if this is not possible due to the fact that at this point blazor has not loaded (as far as I know).

1 Answers

No you cannot load a razor component in index.HTML. But you could change the boring loading.... message with a nice page.

But the best option would be to use server side pre-rendering. This will render your component on startup while the rest of the app loads.

Related