Skip to content

Send HTML as soon as possible #11

Closed
@dvoituron

Description

@dvoituron

For example, if you have a component that is linked to a sub-property, it is better to set default values for all linked properties, instead of testing the initial variable.

// DON'T USE
@if (MyData != null)
{
    <input type="text" value="MyData.Firstname">
}
// PREFERS
<input type="text" value="MyData.Firstname">

@code 
{
     MyData MyData { get; set; } = new MyData();
}

This allows Blazor to send the HTML code to the client who can display it.
Then Blazor, via SignalR, will update the content of the component that is already drawn.
Otherwise, an empty page is displayed to the user, while the whole component is known...
which is not ergonomically pleasant for the user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions