I have a dynamic component that displays various input.razor classes. I have a dropdown that I pull the input type from and adjust the DynamicComponent type
<DynamicComponent Type=ConfigComponentType @ref=ConfigComponent></DynamicComponent>
Once set, the OnParametersSet function for the component runs initially. Great~
If I swap to another component then swap back it runs again. Great~
But if I simply stay on this component, it doesn't call this again. Darn...
As you see, I don't pass any Parameters to the dynamicComponent so I can't easily update the parameters object. I've tried a lot of things including:
- Making the ComponentType null -- nothing
- Hiding the Dynamic component on the UI -- just blinks
- Calling StateHasChanged --nothing
- Calling ConfigComponent.SetParametersAsync(new ParameterView()) -- throws an error: Object reference not set to an instance of an object
I'm trying to call OnParametersSet so that I can re-initialize my object w/ new object instances. Maybe there's another way to do this?
Does any one have any suggestions for how to easily trigger a refresh of my input components?
ConfigComponent
@key
so the renderer engine knows its a new instance...