User-474980206 posted
the best is that CaptchaCheck has an event that the parent can use to update its state. This is cleaner than using Cascading state.
<CaptchaCheck ID="C1" onVerify="@((v) => CaptchaCompleted = v)" />
<input type="button" value="Login" @onclick="Login" />
@code{
[Parameter]
public bool CaptchaCompleted { get; set; } = false;
private async void Login()
{
if (CaptchaCompleted)
{
}
}
in the Captacha component just define:
[Parameter] public EventCallback<bool> OnVerify { get; set; }
and somewhere call:
OnVerify.InvokeAsync(verifyStatus);
see event handling:
https://docs.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?view=aspnetcore-3.1