Reputation: 1285
Whenever I use the @ref syntax in blazor, visual studio gives me a ton of green underlines on my blazor components that use @ref.
Is there a way to disable this warning? Is it resharper maybe?
Example image here: https://i.sstatic.net/EKkdo.jpg
Upvotes: 0
Views: 555
Reputation: 1450
you can enable/disable null warnings at project level with these setting in .csproj file
To disable
<PropertyGroup>
<Nullable>disable</Nullable>
</PropertyGroup>
To enable
<PropertyGroup>
<Nullable>enable</Nullable>
</PropertyGroup>
Upvotes: 0
Reputation: 14553
The cause is your _tableRef
is non-nullable.
Try adding a ?
:
@code {
ProjectUserJobRolesTable? _tableRef;
}
Before:
After:
Upvotes: 2