'Loading razor components dynamically in blazor application
I am trying to load multiple razor components in my blazor application. The current page is having some dictionary object filled dynamically. Just for illustration purpose I am using Employee class example. I know which component I have to load, so I don't need , but loading custom component in loop.
private Dictionary<int, IEnumerable<Employee>> employees;
@foreach(var employee in employees)
{
<EmployeeComponent DeptId="@employee.Key" @bind-Emp="@employee.Value" SomeEvent="EmpIdChanged" />
}@
Is there any downside of this approach considering performance. There could be 10 to 15 employees at max. Or suggest any better approach to do this.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
