Skip to content

Commit

Permalink
Fix Loc component rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieupinte committed Jul 13, 2018
1 parent 6c7ca5b commit 931c6b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
13 changes: 2 additions & 11 deletions lib/Loc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,8 @@ import I18n from 'react-native-i18n'
import { connect } from 'react-redux'
import { Text } from 'react-native'

class Loc extends Component {
shouldComponentUpdate({ locKey, version }) {
return this.props.locKey != locKey || this.props.version != version
}

render() {
const { locKey, customizer, ...props } = this.props

return <Text>{customizer(I18n.t(locKey, props))}</Text>
}
}
const Loc = ({ locKey, customizer, ...props }) =>
<Text>{customizer(I18n.t(locKey, props))}</Text>

Loc.defaultProps = {
customizer: text => text,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-redux-i18n",
"version": "1.0.8",
"version": "1.0.9",
"description": "Provide I18n to your React Native application with Redux",
"license": "MIT",
"author": "matthieupinte",
Expand Down

0 comments on commit 931c6b4

Please sign in to comment.