Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rmdort committed Jul 9, 2018
1 parent 7d3908f commit b3a6635
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/provider.js
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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: {}
};
Expand Down

0 comments on commit b3a6635

Please sign in to comment.