Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidUpdate(prevProps) {
if (this.props.locale !== undefined && this.props.locale !== prevProps.locale) {
try {
i18nLoader(this.props.locale, this.setState, this);
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}
}
}
componentDidMount() {
if (this.props.locale !== undefined) {
try {
i18nLoader(this.props.locale, this.setState, this);
} catch (e) {
// eslint-disable-next-line no-console
console.error(e);
}
}
}
handleLocaleChange(e) {
i18nLoader(e.target.value, this.setState, this);
}
componentDidMount() {
i18nLoader(this.state.locale, this.setState, this);
}
handleLocaleChange(e) {
i18nLoader(e.target.value, this.setState, this);
}
componentDidMount() {
i18nLoader(this.state.locale, this.setState, this);
}