mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
21 lines
382 B
React
21 lines
382 B
React
|
import React from 'react';
|
||
|
|
||
|
export default class LocaleProvider extends React.Component {
|
||
|
getChildContext() {
|
||
|
return {
|
||
|
locale: this.props.locale,
|
||
|
};
|
||
|
}
|
||
|
render() {
|
||
|
return React.cloneElement(this.props.children);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
LocaleProvider.childContextTypes = {
|
||
|
locale: React.PropTypes.object,
|
||
|
};
|
||
|
|
||
|
LocaleProvider.propTypes = {
|
||
|
locale: React.PropTypes.object,
|
||
|
};
|