-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
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
Reducer not getting invoked in .NET 8 Blazor #480
Comments
Interestingly, I attached the Fluxor symbols to the debugger to step through and understand what's happening. In
|
I think the issue lies with the use of I took at look at the after component render documentation to get a sense of what changed here between .NET 7 and .NET 8 as I couldn't remember anything off the top of my head about it. Interestingly, the .NET 8 docs differ from the .NET 7 docs is the added note that "these methods aren't invoked during rendering on the server". As I understand it, the Auto rendering starts on the server, finishes the various lifecycles necessary, then starts to download the WASM client at which point it switches contexts, but that suggests that this lifecycle method is never called in that case as it's always running on the server initially. While this appears to continue to be the best place to put the JS invocations, I would urge you to consider moving the |
i have the same issue, i don't fix it until now. |
The developer opted to go in a different direction and I'm no longer using this library so I'm unable to help you out there. I'd encourage you to file a separate issue detailing the problem you're experiencing and what version you're using in hopes someone else is able to assist. |
I recently migrated several websites to .NET 8's new Blazor Web App approach but swiftly noticed that my Fluxor-powered states weren't working as expected. I think I've narrowed it down to the reducer methods not being invoked as expected, though I'm not yet sure why, but I wanted to post this issue in case this is an issue someone else has experienced and could shed some light on.
I put together a really simple .NET 8 Blazor Web App aligned with the Blazor 01 tutorial just to start there to see if I could get a state with a reducer and action working and while registration appears to work as it should, when I click the button to increment the counter the Dispatcher.Dispatch method is called and.. that appears to be that. The breakpoint in the expected reducer never hits so the state never updates.
I've tried two approaches to the registration and neither one is throwing any issues.
Approach 1 - FeatureState attribute
This appears to pick up without issue as expected.
Approach 2 - Feature class
Again, no obvious issues about this not registering as it should. I've tried the reducer in both formats:
I can put a breakpoint on the return statement and the debugger will never stop on it, but it's not clear what's changed between Blazor 7 and Blazor 8 that would have suddenly broken this. I've assembled a sample repo here.
Any ideas of how to proceed? Thanks!
The text was updated successfully, but these errors were encountered: