I made two components in Blazor that are toggled when a button is pressed, like the following:
<div class="row full-height">
<div class="col-md-12">
@if (condition)
{
<Component1 Parameter="foo">
</Component1>
}
else
{
<Component2 Parameter="bar"></Component2>
}
</div>
</div>
When one of this components rerenders, it performs OnInitialized and OnInitializedAsync again. I was wondering if there's a way I could execute the code inside those methods only once.
Thank you very much!