Each of the .razor files defines a UI component that can be reused.
Index.razor file in a text editor of your choice. The
Index.razor file already exists, and it was created when you ran the
dotnet new command. It's located in the
Pages folder inside the
BlazorApp directory that was created earlier.
Counter component to the app's homepage by adding a
<Counter /> element at the end of the
@page "/" <PageTitle>Index</PageTitle> <h1>Hello, world!</h1> Welcome to your new app. <SurveyPrompt Title="How is Blazor working for you?" /> <Counter />
Once this change is saved, the
dotnet watch command will apply the change to the running app so that the
Counter component shows up on the home page.