I'm trying to understand component re-usability in Blazor.
In this tutorial, the Counter component [which also has a @page directive] is added inside the Index component.
So, is the @page directive ignored for the nested component?
Counter
@page "/counter"
<h1>Counter</h1>
<p role="status">Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
@code {
private int currentCount = 0;
private void IncrementCount()
{
currentCount ++;
}
}
Index
@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<SurveyPrompt Title="How is Blazor working for you?" />
<Counter />