Skip to content

Upgrading redux 0.12 to 1

Breaking0.12.0 → 1.0.1Breaking18New4Changed3Fixed8Other4

BreakingUpgrade verdict

16 breaking changes.

  • You must now wrap multiple reducers with combineReducers before passing them to createStore.
  • Middleware is now applied by wrapping createStore with applyMiddleware rather than passing it to createStore.
  • Async action creators that return functions now require adding redux-thunk and passing it to applyMiddleware.
  • The concept previously called a stateless store is now called a reducer.
Top 3 of 16 that need code or config changes

Drops invariant.

Installs 0 packages in all (was 3).

No longer installs js-tokens, loose-envify.

Breaking16
createStore no longer implicitly combines reducers; use combineReducers explicitly.
createStorecombineReducers
createStore no longer accepts middleware; use applyMiddleware instead.
createStoreapplyMiddleware
The thunk middleware is no longer included by default.
redux-thunkapplyMiddleware
Renames "Stateless Stores" to reducers.
Renames the "Redux instance" to "The Store".
Removes the dispatcher completely.
Renames composeStores to composeReducers.
composeStorescomposeReducers
Removes createDispatcher.
createDispatcher
Renames createRedux to createStore.
createReduxcreateStore
Throws an error if dispatch is attempted while a reducer is executing; dispatching from lifecycle hooks still works.
dispatch
Moves React-specific code to the separate react-redux package, versioned separately.
ProviderprovideConnectorconnect
All middleware now receives { getState, dispatch } as its first parameter.
getStatedispatch
combineReducers now throws if a reducer returns undefined state.
combineReducers@@INIT@@redux/INIT
Provider now accepts a store prop instead of redux.
Providerstoreredux
Changes createStore signature to accept reducer, initialState and middlewares.
createStore
Changes the smart middleware signature to accept an object instead of a single getState function.
getStatedispatch