Blazor dot net 8 server interactive component does not re-render when state changes via redux tools time travel
Closed this issue · 1 comments
AddictArts commented
Hi,
I have a server interactive Blazor app. I have some components that do detect the time travel state changes of redux tools. For example Telerik Grid does. However a simple child component that takes a List of a simple class that has simple data does not re-render. The child has a foreach looping over the list and rendering simple html.
I can't find anything that explains why the Telerik grid re-renders as expexted, but the simple componet does not.
OnParameterSet is when moving back in time, then moving forward again it is not called for that child component.
AddictArts commented
To answer and provide reference for anyone else hitting this.
Using an interface for a parameter to pass data was the main issue.
interface IFoo
{
string bar = "";
}
Parent;
<Child Foo="@State.Value.Foo">
Child:
@foreach (var foo in foos) { ... }
@code {
[parameter]
public List<IFoo> foos = [];
}