Gyoce
Gyoce
CC#
Created by Gyoce on 7/11/2023 in #help
❔ Blazor generic component "Type or namespace could not be found"
Hello, In my blazor app, i have a generic component (with the use of @typeparam T). I have a page which has the call to my component like so : <TableView T="MyClass" /> When i try to add @ref to that component to have the reference inside my code section like so :
<TableView T="MyClass" @ref="myTable" />
@code {
private TableView<MyClass> myTable;
}
<TableView T="MyClass" @ref="myTable" />
@code {
private TableView<MyClass> myTable;
}
It gives me an error "The type or namespace name 'TableView<>' could not be found (are you missing a using directive or an assembly reference?)" Which i don't understand because before adding the @ref it worked great ! PS: i tried to clean then build & rebuild entirely but nothing changed and of course i check all the using statements to include my custom generic component (which worked before adding the @ref on it)
3 replies