Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Depsy] Upgrade dependency react-redux to 4.0.0 #33

Closed
wants to merge 1 commit into from

Conversation

relekang
Copy link
Member

Hi!

A new version was just released of react-redux, so Depsy
has upgraded your project's dependency ranges.

Make sure that it doesn't break anything, and happy merging! :shipit:


Upgraded react-redux to 4.0.0

Changelog:

Version 4.0.0

Breaking Changes

React 0.14 is now required and a peer dependency

If you need 0.13 support, keep using 3.x. In addition, React has now been promoted to be a peer dependency because you’ll use the same react package for web and native.

react-redux/native entry point has been removed

Track this React Native issue and wait until RN works on top of React 0.14. Then React Redux 4.x should “just work” in React Native. Until then, you need to keep using 3.x with React Native.

<Provider> no longer accepts a function child

This resolves a ton of router-related issues and also helps beginners understand what's going on.

Before

React.render(
  <Provider>
    {() => <App />}
  </Provider>,
  rootEl
);

After

ReactDOM.render(
  <Provider>
    <App />
  </Provider>,
  rootEl
);

Refs are now opt-in

connect() no longer provides a ref to the wrapped component by default. You need to specify withRef: true in the options as the fourth argument to connect() to get the old behavior. getWrappedInstance() will throw unless you do that.

This fixes reduxjs/react-redux#141.

Before

class MyComponent extends Component { ... }
MyComponent = connect(mapStateToProps)(MyComponent);

// later
let instance = React.render(<MyComponent />, targetEl);
console.log(instance.getWrappedInstance());

After

class MyComponent extends Component { ... }
MyComponent = connect(mapStateToProps, null, null, { withRef: true })(MyComponent);

// later
let instance = ReactDOM.render(<MyComponent />, targetEl);
console.log(instance.getWrappedInstance());

Version 3.1.0

Version 3.0.1

Version 3.0.0

Breaking Changes Since 3.0.0-alpha

This release is identical to 3.0.0-alpha.
If you’re already using it, you don’t need to change anything.

Breaking Changes Since 2.x

Now the map functions (mapStateToProps, mapDispatchToProps and mergeProps) are not called until React starts to render the connect()ed components. Previously the map functions where called immediately when store changed which could cause weird edge case bugs when the ownProps parameter was a derivative of the state. The state from which it was derivative of was a different version than what was passed as the stateparameter. In some cases the states can be incompatible with each other and cause very confusing bugs in user code.

Unfortunately the state stays consistent only when store dispatches are called in batches ie. from DOM handlers or manually from ReactDOM.unstable_batchedUpdates(fn). Luckily redux-batched-updates middleware can be used to force batching for all dispatches.

If you're interested in the details, feel free to check out:

Version 3.0.0-alpha

Breaking Change

Now the map functions (mapStateToProps, mapDispatchToProps and mergeProps) are not called until React starts to render the connect()ed components. Previously the map functions where called immediately when store changed which could cause weird edge case bugs when the ownProps parameter was a derivative of the state. The state from which it was derivative of was a different version than what was passed as the stateparameter. In some cases the states can be incompatible with each other and cause very confusing bugs in user code.

Unfortunately the states stay consistent only when store dispatches are called in batches ie. from DOM handlers or manually from ReactDOM.unstable_batchedUpdates(fn). Luckily redux-batched-updates middleware can be used to force batching for all dispatches.

If you're interested in the details, feel free to check out:

@ekmartin ekmartin closed this Oct 15, 2015
@ekmartin ekmartin deleted the depsy-react-redux-15_10_15_12_27_09 branch October 15, 2015 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Connect's wrapped component can't be a stateless function
2 participants