# Function createStore

- createStore<S, A, Ext, StateExt>(reducer, enhancer?): Store<S & StateExt, A> & Ext

- #### Type Parameters

  - S
  - A extends Action<any>
  - Ext
  - StateExt

  #### Parameters

  - reducer: Reducer<S, A>
  - `Optional` enhancer: StoreEnhancer<Ext, StateExt>

  #### Returns Store<S & StateExt, A> & Ext

  #### Deprecated

  We recommend using the `configureStore` method of the `@reduxjs/toolkit` package, which replaces `createStore`.

  Redux Toolkit is our recommended approach for writing Redux logic today, including store setup, reducers, data fetching, and more.

  For more details, please read this Redux docs page: https://redux.js.org/introduction/why-rtk-is-redux-today

  `configureStore` from Redux Toolkit is an improved version of `createStore` that simplifies setup and helps avoid common bugs.

  You should not be using the `redux` core package by itself today, except for learning purposes. The `createStore` method from the core `redux` package will not be removed, but we encourage all users to migrate to using Redux Toolkit for all Redux code.

  If you want to use `createStore` without this visual deprecation warning, use the `legacy_createStore` import instead:

  `import { legacy_createStore as createStore} from 'redux'`

  - Defined in common/temp/node_modules/.pnpm/redux@4.2.1/node_modules/redux/index.d.ts:399
- createStore<S, A, Ext, StateExt>(reducer, preloadedState?, enhancer?): Store<S & StateExt, A> & Ext

- #### Type Parameters

  - S
  - A extends Action<any>
  - Ext
  - StateExt

  #### Parameters

  - reducer: Reducer<S, A>
  - `Optional` preloadedState: PreloadedState<S>
  - `Optional` enhancer: StoreEnhancer<Ext, {}>

  #### Returns Store<S & StateExt, A> & Ext

  #### Deprecated

  We recommend using the `configureStore` method of the `@reduxjs/toolkit` package, which replaces `createStore`.

  Redux Toolkit is our recommended approach for writing Redux logic today, including store setup, reducers, data fetching, and more.

  For more details, please read this Redux docs page: https://redux.js.org/introduction/why-rtk-is-redux-today

  `configureStore` from Redux Toolkit is an improved version of `createStore` that simplifies setup and helps avoid common bugs.

  You should not be using the `redux` core package by itself today, except for learning purposes. The `createStore` method from the core `redux` package will not be removed, but we encourage all users to migrate to using Redux Toolkit for all Redux code.

  If you want to use `createStore` without this visual deprecation warning, use the `legacy_createStore` import instead:

  `import { legacy_createStore as createStore} from 'redux'`

  - Defined in common/temp/node_modules/.pnpm/redux@4.2.1/node_modules/redux/index.d.ts:428