I’m new to Blazor and trying to figure out how Blazor renders components into HTML tags. If I use a simple component like this:
<InputText @bind-Value="testvalue" id="sample-textbox></InputText>
@code {
public string testvalue = "abc123";
}
Then I run my app, open dev tools, the resulting HTML is this:
<input id="sample-textbox" _bl_e4f3714a-7294-49f4-9c79-90762626ed41="">
What is the purpose of _bl_e4f3714a-7294-49f4-9c79-90762626ed41
?
2
Answers
It’s simply an identifier that Blazor uses to control DOM elements, in the same way that other frameworks and libraries do.
Others frameworks use Virtual DOMS and the identifier is not visible when the elements are renderer.
For example, Angular uses identifiers like this:
To add my few cents here: there’s this github thread with this comment about it. I will only quote relevant part here:
So this attribute is something "very internal" to Blazor mechanisms.