Skip to content

Commit c45c233

Browse files
committed
Update README - modernize sample code
1 parent c61d627 commit c45c233

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Usually, a startup code of the Blazor WebAssembly app should be like this.
231231

232232
```csharp
233233
var builder = WebAssemblyHostBuilder.CreateDefault(args);
234-
builder.RootComponents.Add<App>("app");
234+
builder.RootComponents.Add<App>("#app");
235235
builder.RootComponents.Add<HeadOutlet>("head::after");
236236
```
237237
However, if you use the `WebAssemblyPrerendered` render mode when prerendering, you should change the startup code below.
@@ -242,7 +242,7 @@ var builder = WebAssemblyHostBuilder.CreateDefault(args);
242242
// already registered via prerednered HTML contents.
243243
if (!builder.RootComponents.Any())
244244
{
245-
builder.RootComponents.Add<App>("app");
245+
builder.RootComponents.Add<App>("#app");
246246
builder.RootComponents.Add<HeadOutlet>("head::after");
247247
}
248248
```

0 commit comments

Comments
 (0)