mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
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:
commit
e8aac413b2
@ -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…
Reference in New Issue
Block a user