-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Hot reload is broken for reducers only. #317
Comments
There's nothing I can do about it on my end. |
@kirill-konshin meaning is this something that should be raised with the folks over at nextJS? |
It depends a lot on how the hot reload of reducer is implemented. You still need to have https://github.com/kirill-konshin/next-redux-wrapper/blob/master/packages/demo/src/components/store.tsx see the demo in this repo |
Explicitly requiring hot reloading, even when redux devtools were added, was never the case on any one project I worked on. In fact, NextJS's own fixed redux example has functioning hot reloading for reducers without ever having to manually call This is an issue with this package specifically. It's not feasible for projects to manually do this, especially with larger ones with reducers splattered all over the place, even external packages. |
@kirill-konshin after some investigation, I've pinpointed the issue: adding the redux store to the window here. Is this absolutely necessary? If we wanted to memoize, wouldn't an explicit I'd open a PR for this, but I'm honestly confused about why the store is assigned to a |
@DanielOrtel thank you for investigation, good catch. It was created long ago, before |
alright, I'll give it a whirl, I also noticed another thing while investigating this, but I'll make a different issue for that, since it's not directly related |
nvm the other thing, it was fixed in the |
Describe the bug
I'm honestly not sure if the culprit is this package or nextJS, but this seems like the most likely candidate. Anyway, I have a weird issue in that hot reload is broken for reducers, and only reducers. Everything else hot reloads on change, except reducers.
Possible related issue from NextJS, where their own with-redux-thunk example had the exact same issue:
vercel/next.js#11794
And their fix:
vercel/next.js#11816
To Reproduce
npx create-next-app
, add redux, next-redux-wrapper, set up per the docs, with no additional bells or whistles(redux-devtools-extension
makes no difference either way).Expected behavior
Hot reloading for reducers works out of the box, without any additional steps.
Screenshots
N/A
Desktop (please complete the following information):
Additional context
If you want I can push an example app for this.
The text was updated successfully, but these errors were encountered: