ratson / react-intl-redux

Redux binding for React Intl.
MIT License
297 stars 48 forks source link

update for react-redux@5.0.3 #26

Closed ecozoic closed 7 years ago

ecozoic commented 7 years ago

React-redux 5.0.3 breaks react-intl-redux. Provider.js imported storeShape from react-redux/lib/utils/storeShape. This file has been renamed to react-redux/lib/utils/PropTypes.

5.0.2: https://github.com/reactjs/react-redux/blob/v5.0.2/src/utils/storeShape.js 5.0.3: https://github.com/reactjs/react-redux/blob/v5.0.3/src/utils/PropTypes.js

All tests are passing. Let me know if anything should be changed.

Thanks!

nicolas-schmitt commented 7 years ago

Hi there @ecozoic, since storeShape isn't exported by react-redux and is therefore most likely going to move and break the import again, would'nt you better of using this instead ?

const storeShape = PropTypes.shape({
  subscribe: PropTypes.func.isRequired,
  dispatch: PropTypes.func.isRequired,
  getState: PropTypes.func.isRequired
});

Provider.propTypes = {
  children: PropTypes.element.isRequired,
  store: storeShape.isRequired,
};
prevostc commented 7 years ago

The quickfix is fine by me for now :D But I agree with @nicolas-schmitt and this enhancement should be the subject of another PR

ratson commented 7 years ago

@ecozoic Thanks for the PR, but I decide to remove the check, and leave that for react-redux v0.4.1 is out with the fix.