Skip to content

[Blazor] Different component rendering logic could be observed between .NET 9 and .NET 10 #64221

@pkostaki

Description

@pkostaki

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Between .NET 9 and .NET 10 there appears to be a change in how Blazor detects parameter changes for value types.

Specifically, when a parent component re-renders on event callback handler and sets a DateTime parameter of a child component:

  • In .NET 9, the child’s OnParametersSet() is called again, child is re-rendered (even if the parameter value did not change).
  • In .NET 10, the child’s OnParametersSet() is not called and child isn't re-rendered (even if parameter value was changed internally in child component)

Parent.razor:

<ChildComponent DateParameter="_date" Update="OnUpdate"></ChildComponent>

@code {
    DateTime _date = new DateTime(2025, 10, 1, 0, 0, 0);

    private void OnUpdate()
    {
        // Leads to re-rendering.
    }
}

Below logs (produced with the single app) could reconstruct the picture

.NET9 logs

ParentComponent.BuildRenderTree(RenderTreeBuilder)
ChildComponent.OnParametersSet() DateParameter: {10/1/2025 12:00:00 AM}
ChildComponent.BuildRenderTree(RenderTreeBuilder)
ParentComponent.BuildRenderTree(RenderTreeBuilder)
ChildComponent.OnParametersSet() DateParameter: {10/1/2025 12:00:00 AM}
ChildComponent.BuildRenderTree(RenderTreeBuilder)
	-> DateParameter value updated internally: {10/31/1950 7:19:40 PM}
	-> call update eventcallback
ParentComponent.OnUpdate()
ParentComponent.BuildRenderTree(RenderTreeBuilder)
ChildComponent.OnParametersSet() DateParameter: {10/1/2025 12:00:00 AM}
ChildComponent.BuildRenderTree(RenderTreeBuilder)

.NET10 logs

ParentComponent.BuildRenderTree(RenderTreeBuilder)
ChildComponent.OnParametersSet() DateParameter: {10/1/2025 12:00:00 AM}
ChildComponent.BuildRenderTree(RenderTreeBuilder)
ParentComponent.BuildRenderTree(RenderTreeBuilder)
ChildComponent.OnParametersSet() DateParameter: {10/1/2025 12:00:00 AM}
ChildComponent.BuildRenderTree(RenderTreeBuilder)
DateParameter value updated internally: {10/31/1950 7:19:40 PM}
	-> call update eventcallback
ParentComponent.OnUpdate()
ParentComponent.BuildRenderTree(RenderTreeBuilder)
// Note, there is no re-rendering of child, i.e., ChildComponent.OnParametersSet() DateParameter: {10/1/2025 12:00:00 AM}; ChildComponent.BuildRenderTree(RenderTreeBuilder)

If this change was intentional, it’s a subtle but important breaking change for components that depend on parameter lifecycle events being invoked consistently.
Clarification from the Blazor team would help determine whether this should be treated as a regression or an intentional diffing optimization, indicating that component authors may need to review their implementations accordingly.
Thanks.

BlazorDateTimeCase.zip

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

.NET 10.0.0-rc.2.25502.107

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions