-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
configureStore type problem #1002
Comments
Figured it out. Needed to manually install redux (not sure how I got this far without it, tbh). |
@AHBruns That doesn't sound right. RTK already depends on the The code you're showing looks correct, so I'm not sure why there would be any issues here. |
@markerikson Yeah, I'm not sure why, but the issue was definitely solved by installing |
same here. Although the @reduxjs/toolkit version is 1.6.0-alpha.0, but it's dependence redux is still 4.0.5 |
Can someone put together a project that reproduces this issue? If this is specifically a problem with the alpha, I need to see this so we can fix it. Additionally, RTK 1.6.0-alpha.0 should depend on |
I tried to reproduce the problem in codesandbox, but everything worked fine. |
Yes, as of React-Redux 7.2.3, we now specifically auto-install |
I was also seeing this error after installing the alpha. It seemed to be caused by the presence of an older version of Redux core. I managed to fix it by re-installing React-Redux. ✅ Working
❌ Broken (after installing the RTK alpha)
✅ Working (after re-installing React-Redux)
|
Hmm. Based on that, I'm not sure there's anything specific we can do to fix this sort of issue.
|
Listed this in the 1.6 release notes as a potential issue. |
Just chiming in to say I ran into the exact same issue today. Gave me a few hours of headscratching.
Wish I'd read this yesterday. Updating |
I ran into this exact same issue but totally pre-loaded states on configure store. The types for preLoadedState parameters in configureStore have changed from DeepPartial to PreLoadedState type which is much more strict on what it allows for the param(1:1 mapping now required). I wouldn't be surprised if the other types in configureStore has changed in most recent update. |
It was pretty much a bug on type level before - you can skip a single reducer's state, but giving a reducer "half" of it's preloaded state will not merge it with the initialState, but leave the other half |
So, I've been following the guides and am trying to dispatch an async thunk from another async thunk. To do this, the docs say I need to do:
Then AppDispatch should include type info for a dispatch that works with thunks. In theory I could then do something like the following:
Unfortunately, this doesn't work. I get the following error:
In fact, AppDispatch doesn't even seem to know anything about thunks.
So, I guess my question is: Why isn't configureStore working as I'm expecting?
The text was updated successfully, but these errors were encountered: