Skip to content

Releases: reduxjs/react-redux

v2.1.1

06 Sep 23:40
Compare
Choose a tag to compare
  • Fixes a warning from React (Warning: setState(...)) that would appear if a connected component is unmounted during a dispatch cycle. See #92, #95

v2.1.0

03 Sep 20:18
Compare
Choose a tag to compare
  • Adds a fourth (bah!) parameter called options. If you pass { pure: false }, the shouldComponentUpdate optimization will be turned off. Don't do this unless you have very good reasons (e.g. depending on library that uses context a lot). This will hurt your app's performance.

v2.0.0

01 Sep 01:32
Compare
Choose a tag to compare

Breaking Changes

Hot reloading reducers is now explicit (#80)

React Redux used to magically allow reducer hot reloading. This magic used to cause problems (reduxjs/redux#301, reduxjs/redux#340), so we made the usage of replaceReducer() for hot reloading explicit (reduxjs/redux#667).

If you used hot reloading of reducers, you'll need to add module.hot API calls to the place where you create the store. (Of course, assuming that you use Webpack.)

Before

import { createStore } from 'redux';
import rootReducer from '../reducers/index';

export default function configureStore(initialState) {
  return createStore(rootReducer, initialState);
}

After

import { createStore } from 'redux';
import rootReducer from '../reducers/index';

export default function configureStore(initialState) {
  const store = createStore(rootReducer, initialState);

  if (module.hot) {
    // Enable Webpack hot module replacement for reducers
    module.hot.accept('../reducers', () => {
      const nextRootReducer = require('../reducers/index');
      store.replaceReducer(nextRootReducer);
    });
  }

  return store;
}

This is more code, but what's happening is now explicit, and this also lets you do this right in index.js instead of creating a separate <Root> component. See reduxjs/redux#667 for a migration example.

process.env.NODE_ENV is required for CommonJS build (#81)

In 0.7.0, we temporarily removed the dependency on it to support React Native, but now that RN 0.10 is out with process.env.NODE_ENV polyfill, we again demand it to be defined. If you're not ready to use RN 0.10, or are in a different environment, either use a browser build, or shim it yourself.

v1.0.1

25 Aug 17:36
Compare
Choose a tag to compare
  • Fix an incorrect warning screen on React Native (#72)

v1.0.0

24 Aug 17:21
Compare
Choose a tag to compare

We're stable!

Breaking Changes

The function passed to <Provider> now has to return an element. In all valid circumstances this should already be the case for your app. For example, <Provider store={store}>{() => 42}</Provider> or <Provider store={store}>{() => {}}</Provider> used to work, but made no sense. Now we're forcing you to return a single valid element.

Improvements

If you use React 0.13, you will see a warning if you attempt to pass a React element instead of a function to <Provider>. For example, <Provide store={store}><MyApp /></Provider> now produces a warning with React 0.13.

However, if you use React 0.14 (currently available as a beta, soon to be released), you can finally pass just the React element! For example, with React 0.14 and React Redux 1.0, you can write <Provider store={store}><MyApp /></Provider>. In fact React Redux will warn you if you use the function syntax together with React 0.14, as it is no longer needed.

v0.9.0

17 Aug 15:14
Compare
Choose a tag to compare
  • Adds ownProps as an optional second parameter to mapStateToProps and mapDispatchToProps: #59, #55. Note that, in order to get it, your functions have to declare it. In other words, they have to have fn.length > 1.

v0.8.2

11 Aug 19:10
Compare
Choose a tag to compare
  • Fixes another issue where deleted props wouldn't get updated (#51)

v0.8.1

11 Aug 16:19
Compare
Choose a tag to compare
  • Fixed child props failing to update when a prop is deleted (#50)

v0.8.0

09 Aug 21:18
Compare
Choose a tag to compare

Breaking Changes

  • While this is very unlikely to break your app, components wrapped with connect() now accept store as an optional prop. So you may avoid using <Provider> after all, as long as you pass store manually all the way down. (We don't suggest you to do this.) This is mostly useful for non-fully-React codebases and stubbing store for tests. If you use <Provider>, just keep using it and don't worry. (#33, #44)

v0.7.0

09 Aug 17:32
Compare
Choose a tag to compare

React Native support fixed

0.5.x and 0.6.0 had a regression that caused an error in React Native due to process.env not being polyfilled.
This release should fix it. (#39)

Breaking Changes

Just some renames:

  • Static property DecoratedComponent => WrappedComponent
  • Instance method getUnferlyingRef() => getWrappedInstance()
  • In addition, the wrapped instance is now available as component.refs.wrappedInstance (#35)