Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

441
Views
createStore is @deprecated so im trying to replace with configurationStore

createStore is @deprecated so im trying to replace with configurationStore, i think the post data from my cluster is not showing because of that

```

import React from 'react';
import ReactDom from 'react-dom/client';
import { Provider } from 'react-redux';
import {createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';

import reducers from "./reducers";

import App from './App'

const store = createStore(reducers, (compose(applyMiddleware(thunk))))
const root = ReactDom.createRoot(document.getElementById("root"));

root.render(
    <Provider store={store}>
        <App />
    </Provider>
);


And im trying to do it like this:

    

import React from 'react';
import ReactDom from 'react-dom/client';
import { Provider } from 'react-redux';
import { applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { configureStore } from '@reduxjs/toolkit'

import reducers from "./reducers";

import App from './App'

const store = configureStore(reducers, (compose(applyMiddleware(thunk))))
const root = ReactDom.createRoot(document.getElementById("root"));


root.render(
<Provider store={store}>
    <App />
</Provider>
);

```

Of Course it didn't work i'm trying to figure out how it could be

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You would do

const store = configureStore({ reducer: reducers })

The thunk middleware is active automatically. compose and applyMiddleware are not needed any more. So is combineReducers.

If you had

const reducers = combineReducers({
  a: reducerA,
  b: reducerB
})

you could also just instead do

const store = configureStore({ 
  reducer: {
    a: reducerA,
    b: reducerB
  }
})

If you were still using createStore, that means that you were generally using an outdated style of Redux that is about 4x times the code of modern Redux.

Modern Redux does not use switch..case reducer, ACTION_TYPE constants, immutable reducer logic, hand-written action creators or connect & mapStateToProps. You might have been misled by an outdated tutorial.

I would highly recommend you to follow the official Redux tutorial which will leave you with knowledge of modern Redux and in the end much cleaner and easy to maintain code.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!