Skip to content

Commit

Permalink
Merge pull request ant-design#13250 from damiangreen/migrate-locale-p…
Browse files Browse the repository at this point in the history
…rovider-to-new-lifecycle-method

Migrate locale provider to new lifecycle method
  • Loading branch information
ilanus authored Nov 23, 2018
2 parents 8a021e6 + 83b30d7 commit e8aac41
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions components/locale-provider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit e8aac41

Please sign in to comment.