We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I inherit from ReactiveInjectableComponentBase<T> to attach a ViewModel to a View, the View gets rendered twice on each activation.
ReactiveInjectableComponentBase<T>
For comparison, the same View and ViewModel with the ViewModel being attached by an [Inject] attribute, the View is rendered only once.
[Inject]
Check the linked reproduction repository.
ViewWithInherits.razor
@inherits ReactiveInjectableComponentBase<T>
ViewWithInject.razor
I verified the number of render cycles with the debugger, the counter property and Trace message (not in the example).
https://github.com/Lukzy/ReactiveUI.ExecutedTwiceBug
Both ways of attaching a ViewModel should behave the same. I would expect the View to be only rendered once.
No response
Visual Studio 2022
Windows 10 Enterprise
10.0.19044 Build 19044
LENOVO X1
18.0.10
Behavior tested with these browsers:
The text was updated successfully, but these errors were encountered:
I spent few hours trying to figure out what I did that was wrong.
Sorry, something went wrong.
This bug is still present in the latest version 19.5.1. It looks like it gets rendered again from ReactiveInjectableComponentBase.OnAfterRender.
Also changing the render mode does not help ether. This bug is really bad and i dont get why its not fixed yet. Is ReactiveUI for blazor dead?
No branches or pull requests
Describe the bug 🐞
If I inherit from
ReactiveInjectableComponentBase<T>
to attach a ViewModel to a View, the View gets rendered twice on each activation.For comparison, the same View and ViewModel with the ViewModel being attached by an
[Inject]
attribute, the View is rendered only once.Step to reproduce
Check the linked reproduction repository.
ViewWithInherits.razor
uses@inherits ReactiveInjectableComponentBase<T>
and will be rendered twiceViewWithInject.razor
uses[Inject]
attribute and will be rendered onceI verified the number of render cycles with the debugger, the counter property and Trace message (not in the example).
Reproduction repository
https://github.com/Lukzy/ReactiveUI.ExecutedTwiceBug
Expected behavior
Both ways of attaching a ViewModel should behave the same. I would expect the View to be only rendered once.
Screenshots 🖼️
No response
IDE
Visual Studio 2022
Operating system
Windows 10 Enterprise
Version
10.0.19044 Build 19044
Device
LENOVO X1
ReactiveUI Version
18.0.10
Additional information ℹ️
Behavior tested with these browsers:
The text was updated successfully, but these errors were encountered: