I'm new to SPA frameworks and Blazor so this will probably be an easy question to answer, although I couldn't find an answer anywhere else.
I want to show a component somewhere on the page as soon as the user clicks on a particular button. I have currently implemented it this way:
@page "/test"
<button type="button" @onclick="() => showSignUpComponent = true">
Show Sign Up Window
</button>
@if (showSignUpComponent)
{
<SignUp />
}
@code {
bool showSignUpComponent;
}
I was wondering if there is a better and cleaner way (i.e. the right way) to do something like this in Blazor, or is this the common and the "standard" way?