Skip to content

Commit 0ccf045

Browse files
committed
Undo sample changes
1 parent 2be1c4b commit 0ccf045

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/Components/Samples/BlazorUnitedApp/Pages/Counter.razor

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,15 @@
44

55
<h1>Counter</h1>
66

7-
<p role="status">Current count: @Current.Count</p>
7+
<p role="status">Current count: @currentCount</p>
88

99
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
1010

1111
@code {
12-
13-
[SupplyParameterFromPersistentComponentState]
14-
public CounterState Current { get; set; } = new();
15-
16-
protected override void OnInitialized()
17-
{
18-
Current ??= new CounterState() { Count = RendererInfo.IsInteractive ? 0 : 5 };
19-
}
12+
private int currentCount = 0;
2013

2114
private void IncrementCount()
2215
{
23-
Current.Increment();
24-
}
25-
26-
public class CounterState
27-
{
28-
public int Count { get; set; } = 0;
29-
30-
public void Increment()
31-
{
32-
Count++;
33-
}
16+
currentCount++;
3417
}
3518
}

0 commit comments

Comments
 (0)