Skip to content

Commit

Permalink
Merge pull request #205 from Alex509/master
Browse files Browse the repository at this point in the history
Suppresses required context type warning if passing i18n as a prop
  • Loading branch information
jamuhl authored Sep 25, 2016
2 parents 7b211fb + 58b6c8e commit 97cf874
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion __tests__/translate-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('translate', () => {
Elem.NOT_KNOWN_REACT_STATIC = 'IS HOISTED ?';
const wrapped = wrap(Elem);
expect(wrapped.WrappedComponent).toBe(Elem);
expect(wrapped.contextTypes.i18n).toBe(React.PropTypes.object.isRequired);
expect(wrapped.contextTypes.i18n).toBe(React.PropTypes.object);
expect(wrapped.childContextTypes.t).toBe(React.PropTypes.func.isRequired);
expect(wrapped.displayName).toBe('Translate(Elem)');
expect(wrapped.namespaces.length).toBe(2);
Expand Down
2 changes: 1 addition & 1 deletion src/translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default function translate(namespaces, options = {}) {
Translate.WrappedComponent = WrappedComponent;

Translate.contextTypes = {
i18n: PropTypes.object.isRequired
i18n: PropTypes.object
};

Translate.childContextTypes = {
Expand Down

0 comments on commit 97cf874

Please sign in to comment.