Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

434
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda