mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
migrate locale provider to new lifecycle method
This commit is contained in:
parent
5dc5ab13bc
commit
83b30d7513
@ -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