Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rmdort committed Jul 8, 2018
1 parent 7443ba6 commit a7b5b02
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ import React, { Children } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { supplant, translateKey, createHTMLMarkup } from './utils'
import { setLocale } from './actions'
import { TranslateProvider } from './context'

class IntlProvider extends React.Component {
constructor (props) {
super(props)
const { translations, locale, setLocale } = props
const { translations, locale } = props
if (!translations || !locale) {
let namePart = this.constructor.displayName ? ' of ' + this.constructor.displayName : ''
throw new Error('Could not find translations or locale on this.props ' + namePart)
Expand Down Expand Up @@ -49,4 +48,4 @@ function mapPropsToState (state) {
}
}

export default connect(mapPropsToState, { setLocale })(IntlProvider)
export default connect(mapPropsToState)(IntlProvider)

0 comments on commit a7b5b02

Please sign in to comment.