I have a SSR Parent component with a Child component with InteractiveServer render mode. I need this child component to be interactive so that I can bind to events like @onclick etc. I want to pass data/value back to the parent using EventCallback but this delegate is never set I guess due to different render modes, is there another way to do this?
Parent.razor
<Child
@rendermode="InteractiveServer"
OnNameEntered="@DisplayName"/>
@code {
public void DisplayName(string result) {
Console.WriteLine($"Result is {result}");
}
}
Child.razor
<input @bind="name"/>
<button type="button" @onclick="NameEntered">Click</button>
@code {
[Parameter]
public EventCallback<string> OnNameEntered { get; set; }
private string name;
public async Task NameEntered() {
await OnNameEntered.InvokeAsync(name);
}
I tried removing the InteractiveRender mode on the child and the delegate would properly pass to the child but then it would remove all interactivity within that component.