@@ -371,35 +371,135 @@ export interface StoreCreator {
371371 ) : Store < S & StateExt , A > & Ext
372372}
373373
374+ /**
375+ * @deprecated
376+ *
377+ * **We recommend using the `configureStore` method
378+ * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
379+ *
380+ * Redux Toolkit is our recommended approach for writing Redux logic today,
381+ * including store setup, reducers, data fetching, and more.
382+ *
383+ * **For more details, please read this Redux docs page:**
384+ * **https://redux.js.org/introduction/why-rtk-is-redux-today**
385+ *
386+ * `configureStore` from Redux Toolkit is an improved version of `createStore` that
387+ * simplifies setup and helps avoid common bugs.
388+ *
389+ * You should not be using the `redux` core package by itself today, except for learning purposes.
390+ * The `createStore` method from the core `redux` package will not be removed, but we encourage
391+ * all users to migrate to using Redux Toolkit for all Redux code.
392+ *
393+ * If you want to use `createStore` without this visual deprecation warning, use
394+ * the `legacy_createStore` import instead:
395+ *
396+ * `import { legacy_createStore as createStore} from 'redux'`
397+ *
398+ */
399+ export declare function createStore < S , A extends Action , Ext , StateExt > (
400+ reducer : Reducer < S , A > ,
401+ enhancer ?: StoreEnhancer < Ext , StateExt >
402+ ) : Store < S & StateExt , A > & Ext
403+ /**
404+ * @deprecated
405+ *
406+ * **We recommend using the `configureStore` method
407+ * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
408+ *
409+ * Redux Toolkit is our recommended approach for writing Redux logic today,
410+ * including store setup, reducers, data fetching, and more.
411+ *
412+ * **For more details, please read this Redux docs page:**
413+ * **https://redux.js.org/introduction/why-rtk-is-redux-today**
414+ *
415+ * `configureStore` from Redux Toolkit is an improved version of `createStore` that
416+ * simplifies setup and helps avoid common bugs.
417+ *
418+ * You should not be using the `redux` core package by itself today, except for learning purposes.
419+ * The `createStore` method from the core `redux` package will not be removed, but we encourage
420+ * all users to migrate to using Redux Toolkit for all Redux code.
421+ *
422+ * If you want to use `createStore` without this visual deprecation warning, use
423+ * the `legacy_createStore` import instead:
424+ *
425+ * `import { legacy_createStore as createStore} from 'redux'`
426+ *
427+ */
428+ export declare function createStore < S , A extends Action , Ext , StateExt > (
429+ reducer : Reducer < S , A > ,
430+ preloadedState ?: PreloadedState < S > ,
431+ enhancer ?: StoreEnhancer < Ext >
432+ ) : Store < S & StateExt , A > & Ext
433+
374434/**
375435 * Creates a Redux store that holds the state tree.
436+ *
437+ * **We recommend using `configureStore` from the
438+ * `@reduxjs/toolkit` package**, which replaces `createStore`:
439+ * **https://redux.js.org/introduction/why-rtk-is-redux-today**
440+ *
376441 * The only way to change the data in the store is to call `dispatch()` on it.
377442 *
378443 * There should only be a single store in your app. To specify how different
379- * parts of the state tree respond to actions, you may combine several
380- * reducers
444+ * parts of the state tree respond to actions, you may combine several reducers
381445 * into a single reducer function by using `combineReducers`.
382446 *
383- * @template S State object type.
447+ * @param {Function } reducer A function that returns the next state tree, given
448+ * the current state tree and the action to handle.
384449 *
385- * @param reducer A function that returns the next state tree, given the
386- * current state tree and the action to handle.
450+ * @param {any } [preloadedState] The initial state. You may optionally specify it
451+ * to hydrate the state from the server in universal apps, or to restore a
452+ * previously serialized user session.
453+ * If you use `combineReducers` to produce the root reducer function, this must be
454+ * an object with the same shape as `combineReducers` keys.
387455 *
388- * @param [preloadedState] The initial state. You may optionally specify it to
389- * hydrate the state from the server in universal apps, or to restore a
390- * previously serialized user session. If you use `combineReducers` to
391- * produce the root reducer function, this must be an object with the same
392- * shape as `combineReducers` keys.
456+ * @param {Function } [enhancer] The store enhancer. You may optionally specify it
457+ * to enhance the store with third-party capabilities such as middleware,
458+ * time travel, persistence, etc. The only store enhancer that ships with Redux
459+ * is `applyMiddleware()`.
460+ *
461+ * @returns {Store } A Redux store that lets you read the state, dispatch actions
462+ * and subscribe to changes.
463+ */
464+ export declare function legacy_createStore < S , A extends Action , Ext , StateExt > (
465+ reducer : Reducer < S , A > ,
466+ enhancer ?: StoreEnhancer < Ext , StateExt >
467+ ) : Store < S & StateExt , A > & Ext
468+ /**
469+ * Creates a Redux store that holds the state tree.
393470 *
394- * @param [enhancer] The store enhancer. You may optionally specify it to
395- * enhance the store with third-party capabilities such as middleware, time
396- * travel, persistence, etc. The only store enhancer that ships with Redux
397- * is `applyMiddleware()`.
471+ * **We recommend using `configureStore` from the
472+ * `@reduxjs/toolkit` package**, which replaces `createStore`:
473+ * **https://redux.js.org/introduction/why-rtk-is-redux-today**
398474 *
399- * @returns A Redux store that lets you read the state, dispatch actions and
400- * subscribe to changes.
475+ * The only way to change the data in the store is to call `dispatch()` on it.
476+ *
477+ * There should only be a single store in your app. To specify how different
478+ * parts of the state tree respond to actions, you may combine several reducers
479+ * into a single reducer function by using `combineReducers`.
480+ *
481+ * @param {Function } reducer A function that returns the next state tree, given
482+ * the current state tree and the action to handle.
483+ *
484+ * @param {any } [preloadedState] The initial state. You may optionally specify it
485+ * to hydrate the state from the server in universal apps, or to restore a
486+ * previously serialized user session.
487+ * If you use `combineReducers` to produce the root reducer function, this must be
488+ * an object with the same shape as `combineReducers` keys.
489+ *
490+ * @param {Function } [enhancer] The store enhancer. You may optionally specify it
491+ * to enhance the store with third-party capabilities such as middleware,
492+ * time travel, persistence, etc. The only store enhancer that ships with Redux
493+ * is `applyMiddleware()`.
494+ *
495+ * @returns {Store } A Redux store that lets you read the state, dispatch actions
496+ * and subscribe to changes.
401497 */
402- export const createStore : StoreCreator
498+ export declare function legacy_createStore < S , A extends Action , Ext , StateExt > (
499+ reducer : Reducer < S , A > ,
500+ preloadedState ?: PreloadedState < S > ,
501+ enhancer ?: StoreEnhancer < Ext >
502+ ) : Store < S & StateExt , A > & Ext
403503
404504/**
405505 * A store enhancer is a higher-order function that composes a store creator
0 commit comments