Browse Source

migrate locale provider to new lifecycle method

pull/13250/head
Damian Green 6 years ago
parent
commit
83b30d7513
  1. 11
      components/locale-provider/index.tsx

11
components/locale-provider/index.tsx

@ -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);
}

Loading…
Cancel
Save