react-i18next
Advanced tools
Comparing version 0.0.0 to 0.0.1
{ | ||
"name": "react-i18next", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "i18next plugin for jquery usage", | ||
@@ -5,0 +5,0 @@ "main": "./bin/index.js", |
@@ -57,3 +57,3 @@ # react-i18next | ||
function TranslatableView(props) { | ||
const { t } from props; | ||
const { t } = props; | ||
@@ -64,3 +64,3 @@ return ( | ||
<p>{t('anotherNamespace:key.from.another.namespace', { /* options t options */ })}</p> | ||
<div> | ||
</div> | ||
) | ||
@@ -67,0 +67,0 @@ } |
@@ -15,6 +15,4 @@ import React, { Component, PropTypes } from 'react'; | ||
i18n = context.i18n; | ||
} | ||
getInitialState () { | ||
return { | ||
this.state = { | ||
i18nLoadedAt: null | ||
@@ -25,2 +23,4 @@ }; | ||
componentWillMount() { | ||
this.mounted = true; | ||
i18n.loadNamespaces(namespaces); | ||
t = i18n.getFixedT(null, namespaces); | ||
@@ -31,3 +31,3 @@ } | ||
this.onI18nChanged = () => { | ||
if (!this.isMounted()) return; | ||
if (!this.mounted) return; | ||
@@ -41,2 +41,3 @@ this.setState({ i18nLoadedAt: new Date() }); | ||
componentWillUnmount() { | ||
this.mounted = false; | ||
if (this.onI18nChanged) { | ||
@@ -49,3 +50,3 @@ i18n.off('languageChanged', this.onI18nChanged); | ||
onI18nChange() { | ||
if (!this.isMounted()) return; | ||
if (!this.mounted) return; | ||
@@ -52,0 +53,0 @@ this.setState({ i18nLoadedAt: new Date() }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24428
262