Skip to content

Commit 732af77

Browse files
author
Ajay kumar
committed
[Tech] [Ajay|Abdul]: Fixed Duplicate root element registration becuase of pre-rendering
1 parent 8fc1401 commit 732af77

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

TestArena/Program.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
using TestArena;
44

55
var builder = WebAssemblyHostBuilder.CreateDefault(args);
6-
builder.RootComponents.Add<App>("#app");
7-
builder.RootComponents.Add<HeadOutlet>("head::after");
6+
if (!builder.RootComponents.Any())
7+
{
8+
builder.RootComponents.Add<App>("#app");
9+
builder.RootComponents.Add<HeadOutlet>("head::after");
10+
}
11+
812

913
ConfigureServices(builder.Services, builder.HostEnvironment.BaseAddress);
1014

0 commit comments

Comments
 (0)