I am trying to understand how InteractiveServer works in Blazor.
When using InteractiveServer, does it only re-render the variable currentCount to show the updated value, or does it re-render the entire page to reflect the updated currentCount?
Here is an example code snippet:
@page "/counter"@rendermode InteractiveServer<PageTitle>Counter</PageTitle><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++; }}The documentation does not clearly explain how InteractiveServer updates or re-renders the changed value Microsoft InteractiveServer documentation..
Can someone clarify this behavior?
I have been reading the Microsoft InteractiveServer documentation on InteractiveServer to understand its behavior.
I excepted the InteractiveServer to either:
- Only re-render the
currentCountvariable to reflect the updated count, or - Re-render the entire page to reflect the updated
currentCount.
However, the Microsoft InteractiveServer documentation does not specify which behavior occurs, and I haven't been able to determine this from my own testing.