-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
createStore got deprecated #122
Comments
Apparently, when you install the redux toolkit createStore() becomes depreciated, you can replace it with configureStore() which wraps createStore() to provide simplified configuration options. A good example to config a store is: import React from 'react'; import reducers from "./reducers"; import App from './App'; const store = configureStore({ reducer: reducers }) you can check out the redux toolkit solution to configureStore Hopefully this helps. |
Getting the same issue... please advise with an example from the video ex(reducer, middleware, etc) |
I think this should work: import { Provider } from 'react-redux'; // initialize redux' import App from './App'; const store = configureStore(reducers, compose(applyMiddleware(thunk))); |
I'm stuck on this step as well. My code looks like this.
|
Apparently what I'm thinking is you are using the latest redux toolkit, All the logic related to configuring the store - including importing reducers, middleware, and enhancers - is handled in a dedicated file in a configureStore function import React from 'react'; import reducers from "./reducers"; import App from './App'; const store = configureStore({ reducer: reducers }) You could refer to the redux toolkit for more clarity. |
For the record this has nothing to do with your actual application code. It is specifically a message to users like you who are using "plain Redux" - it's trying to tell you that you're following patterns that are much harder to use, and we want you to use Redux Toolkit instead because it will make your life much easier :) You'll note that this isn't even a runtime warning being printed in the console - it's literally just a visual indicator in your editor, like createStore. |
Hey, tried your fix but it didnt work. Check out my code par the same issue. Will appreciate your assistance. |
FYI: @solodev02, @EduardoBDonovan, @Gagenrllc Issue fixed!
NPMnpm install @reduxjs/toolkit Yarnyarn add @reduxjs/toolkit
Job done! |
getting a error after installing react-toolkit
because createStore function is no more present in the 'redux' module
what to do?
it was told in the video that once we paste the json file we don't have to install anymore dependencies any more for client , may we this could be the reason for the error?
how to fix it.
The text was updated successfully, but these errors were encountered: