@for (var i = 1; i <= Max; i++)
{
// Copy the loop variable: every lambda in a for loop shares the same i.
var stars = i;
}
@code {
// The parent owns the value and passes it in. This component never assigns it.
[Parameter] public int Value { get; set; }
[Parameter] public int Max { get; set; } = 5;
// EventCallback carries a value to the parent. InvokeAsync runs the parent's method
// and then renders the parent, because the callback remembers which component created it.
[Parameter] public EventCallback OnRate { get; set; }
// EventCallback without a type argument: "this happened", no value.
[Parameter] public EventCallback OnClear { get; set; }
}