BlazorStateComponent Inheritance #305
-
If I understand correctly, Blazor components that make use of BlazorState need to inherit from the BlazorStateComponent class. On the project that I am currently working on, I am using ReactiveUI.Blazor, and several of my components already inherit from ReactiveUI.Blazor.ReactiveComponentBase or ReactiveInjectableComponentBase. Since multiple class inheritance is not permitted in C#, how would I go about using both features? Is there an injectable BlazorState provider or factory? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Good morning and thanks for checking out, BlazorState. The BlazorStateComponent is NOT required but supplied as convenient method of pulling in BlazorState functionality. You can implement IBlazorStateComponent yourself in your own component/base component that inherits from one of the ReactiveUI bases classes like The source code can show ideas of what you may want in your base class. Api Docs may be helpful. If you have any issues join our discord channel, an invite is in the Readme, and I will help you out. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Thanks, this really helps!!! |
Beta Was this translation helpful? Give feedback.
Good morning and thanks for checking out, BlazorState.
The BlazorStateComponent is NOT required but supplied as convenient method of pulling in BlazorState functionality.
You can implement IBlazorStateComponent yourself in your own component/base component that inherits from one of the ReactiveUI bases classes like
public class MyComponent : ReactiveComponentBase ,
IBlazorStateComponent
{
[Inject] public IMediator Mediator { get; set; }
[Inject] public IStore Store { get; set; }
public void ReRender() => StateHasChanged();
}
The source code can show ideas of what you may want in your base class.
Api Docs may be helpful.
If you have any issues join our discord channel, an invite is in the …