Releases: reduxjs/react-redux
v2.1.2
v2.1.1
v2.1.0
- Adds a fourth (bah!) parameter called
options
. If you pass{ pure: false }
, theshouldComponentUpdate
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
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
v1.0.0
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
v0.8.2
v0.8.1
v0.8.0
Breaking Changes
- While this is very unlikely to break your app, components wrapped with
connect()
now acceptstore
as an optional prop. So you may avoid using<Provider>
after all, as long as you passstore
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)