We no longer need to inherit from ComponentBase. This was the pattern when code-behind was done through inheritance. With partial classes ComponentBase should be available from the other part(ial).
However, it's likely you'll still need the using statement for proper scope and more importantly the [Inject] attribute.
using Microsoft.AspNetCore.Components;
Thank you very much for pointing that out, Ed. I was not aware of this change. I don't think it hurts to define it the way I do it above, but it's great to see that it is not required anymore.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
We no longer need to inherit from ComponentBase. This was the pattern when code-behind was done through inheritance. With partial classes ComponentBase should be available from the other part(ial).
However, it's likely you'll still need the using statement for proper scope and more importantly the [Inject] attribute.
using Microsoft.AspNetCore.Components;
Thank you very much for pointing that out, Ed. I was not aware of this change. I don't think it hurts to define it the way I do it above, but it's great to see that it is not required anymore.