Closed satazor closed 6 years ago
The reason is that we might use the enhancer to translate stuff inside a component that also uses ...restProps to passdown props to a DOM element. Previously we had to declare the dispatch prop in the component just omit it:
...restProps
dispatch
const SomeComponent = ({ p, dispatch, ...restProps }) => <div { ...restProps }>{ p.t('foo') }</div>; SomeComponent.propTypes = { p: PropTypes.object.isRequired, dispatch: PropTypes.func.isRequired, }; export default translate(SomeComponent);
With this change, it's no longer necessary to do that:
const SomeComponent = ({ p, ...restProps }) => <div { ...restProps }>{ p.t('foo') }</div>; SomeComponent.propTypes = { p: PropTypes.object.isRequired, }; export default translate(SomeComponent);
Unrelated to this PR: prop-types dependency was missing
prop-types
@guillaumearm Do you have some time to take a look at this?
redux-polyglot@0.6.4 is out 🎉
redux-polyglot@0.6.4
The reason is that we might use the enhancer to translate stuff inside a component that also uses
...restProps
to passdown props to a DOM element. Previously we had to declare thedispatch
prop in the component just omit it:With this change, it's no longer necessary to do that:
Unrelated to this PR:
prop-types
dependency was missing