Open Sire opened 5 years ago
Solved it. Inheriting from BlazorComponent isn't required, you can use it's interfaces instead. So in my code-behind classes I just inherit from this class that contains both the state component AND the BlazorComponent interfaces.
public class BlazorComponentBase : StateComponent, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
I can help update the documentation if you think more will run into this problem.
I want to avoid using inheritance (@inherits MyAppComponent) because my pages and components often already use inheritance. (Plus we favor composition anyway right?)
Most of my pages inherit from class that inherits from BlazorComponent. Containing all the page/view functions, similar to a code-behind class in regular ASP.NET as recommended here.
I tried injecting and just instantiating the MyAppComponent(), neither works. Perhaps I'm missing something obvious @torhovland?