Description
It's a bit unusual to remove a parameter value that you're passing to a child component, but if you do, our upcoming hot-reload-refresh mechanism doesn't yet account for it.
Repro: In the default project template, in Index.razor
, change this:
<SurveyPrompt Title="How is Blazor working for you?" />
... to this:
<SurveyPrompt />
No change will show up in the UI. This is because the existing SurveyPrompt
instance already has a value for its Title
property. Failing to supply a new value just means that the old one doesn't get overwritten.
Expected resolution
We can't control how all IComponent
types deal with the removal of an incoming parameter value, but for ComponentBase
at least, we can add some logic to SetParametersAsync
that checks the IsHotReload
flag and, if found, runs through some new code path to default
-out all of its [Parameter]
properties before receiving the new set from its parent.
Severity
Low. I don't think this is a common scenario at all.