Merge pull request #13250 from damiangreen/migrate-locale-provider-to-new-lifecycle-method

Migrate locale provider to new lifecycle method
This commit is contained in:
Ilan 2018-11-23 22:21:42 +01:00 committed by GitHub
commit e8aac413b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,16 +59,11 @@ export default class LocaleProvider extends React.Component<LocaleProviderProps,
};
}
componentWillReceiveProps(nextProps: LocaleProviderProps) {
componentDidUpdate(prevProps: LocaleProviderProps) {
const { locale } = this.props;
const nextLocale = nextProps.locale;
if (locale !== nextLocale) {
setMomentLocale(nextProps.locale);
if (prevProps.locale !== locale) {
setMomentLocale(locale);
}
}
componentDidUpdate() {
const { locale } = this.props;
changeConfirmLocale(locale && locale.Modal);
}