From 931c6b4f222a214cb716fc6b5053c0e38a8aa13f Mon Sep 17 00:00:00 2001 From: Matthieu Pinte Date: Fri, 13 Jul 2018 09:01:49 +0200 Subject: [PATCH] Fix Loc component rendering --- lib/Loc.js | 13 ++----------- package.json | 2 +- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/lib/Loc.js b/lib/Loc.js index 851d845..251de75 100644 --- a/lib/Loc.js +++ b/lib/Loc.js @@ -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 {customizer(I18n.t(locKey, props))} - } -} +const Loc = ({ locKey, customizer, ...props }) => + {customizer(I18n.t(locKey, props))} Loc.defaultProps = { customizer: text => text, diff --git a/package.json b/package.json index b8c80d8..0bdc501 100644 --- a/package.json +++ b/package.json @@ -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",