Skip to content

Blazor is calling properties get on every user interaction #9863

Closed
@alexandrereyes

Description

@alexandrereyes

Why Blazor calls property get every time a user interact with some component?
For example:

@FullName

<button onclick="@(() => Console.Write(""))">button</button>

@functions{


    public string GivenNames { get; set; }
    public string FamilyName { get; set; }
    public string FullName => $"{GivenNames} {FamilyName}";

}

When I hit the button, FullName is recalculated again, why does this happen? The button above doesn't interact with anything.

This can lead to a huge performance problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: By DesignResolved because the behavior in this issue is the intended design.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