From b3a6635a1d45a6a59c1df0de584a89bd2d92cbc7 Mon Sep 17 00:00:00 2001 From: Vinay Date: Mon, 9 Jul 2018 19:21:57 +0800 Subject: [PATCH] Cleanup --- src/provider.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/provider.js b/src/provider.js index a89c40a..360c299 100644 --- a/src/provider.js +++ b/src/provider.js @@ -1,4 +1,4 @@ -import React, { Children } from 'react' +import React from 'react' import PropTypes from 'prop-types' import { connect } from 'react-redux' import { supplant, translateKey, createHTMLMarkup } from './utils' @@ -7,12 +7,14 @@ import { TranslateProvider } from './context' class IntlProvider extends React.Component { constructor (props) { super(props) - const { translations, locale } = props - if (!translations || !locale) { + if (!props.translations || !props.locale) { let namePart = this.constructor.displayName ? ' of ' + this.constructor.displayName : '' throw new Error('Could not find translations or locale on this.props ' + namePart) } } + static propTypes = { + translations: PropTypes.object + }; static defaultProps = { translations: {} };