migrate locale provider to new lifecycle method

This commit is contained in:
Damian Green 2018-11-21 14:38:27 +00:00
parent 5dc5ab13bc
commit 83b30d7513

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 { locale } = this.props;
const nextLocale = nextProps.locale; if (prevProps.locale !== locale) {
if (locale !== nextLocale) { setMomentLocale(locale);
setMomentLocale(nextProps.locale);
} }
}
componentDidUpdate() {
const { locale } = this.props;
changeConfirmLocale(locale && locale.Modal); changeConfirmLocale(locale && locale.Modal);
} }