1 | initial version |
The method for transforming createStore into configureStore involves following these steps:
import { configureStore } from '@reduxjs/toolkit';
createStore
function call with configureStore
.configureStore
: reducer
, middleware
, and devTools
. For example:const store = configureStore({
reducer: {
// reducers
},
middleware: [/* middlewares */],
devTools: process.env.NODE_ENV !== 'production',
});
createStore
.store.dispatch
, store.getState()
) in your application code to use the appropriate new syntax.