1 | import _extends from 'babel-runtime/helpers/extends';
|
2 | import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
|
3 | import _createClass from 'babel-runtime/helpers/createClass';
|
4 | import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
|
5 | import _inherits from 'babel-runtime/helpers/inherits';
|
6 | import PropTypes from 'prop-types';
|
7 | import React from 'react';
|
8 |
|
9 | var LocaleProvider = function (_React$Component) {
|
10 | _inherits(LocaleProvider, _React$Component);
|
11 |
|
12 | function LocaleProvider() {
|
13 | _classCallCheck(this, LocaleProvider);
|
14 |
|
15 | return _possibleConstructorReturn(this, (LocaleProvider.__proto__ || Object.getPrototypeOf(LocaleProvider)).apply(this, arguments));
|
16 | }
|
17 |
|
18 | _createClass(LocaleProvider, [{
|
19 | key: 'getChildContext',
|
20 | value: function getChildContext() {
|
21 | return {
|
22 | antLocale: _extends({}, this.props.locale, { exist: true })
|
23 | };
|
24 | }
|
25 | }, {
|
26 | key: 'render',
|
27 | value: function render() {
|
28 | return React.Children.only(this.props.children);
|
29 | }
|
30 | }]);
|
31 |
|
32 | return LocaleProvider;
|
33 | }(React.Component);
|
34 |
|
35 | export default LocaleProvider;
|
36 |
|
37 | LocaleProvider.propTypes = {
|
38 | locale: PropTypes.object
|
39 | };
|
40 | LocaleProvider.childContextTypes = {
|
41 | antLocale: PropTypes.object
|
42 | }; |
\ | No newline at end of file |