UNPKG

1.22 kBJavaScriptView Raw
1import _extends from 'babel-runtime/helpers/extends';
2import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
3import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
4import _inherits from 'babel-runtime/helpers/inherits';
5import React from 'react';
6import PropTypes from 'prop-types';
7
8export default function withContext(Radio) {
9 var _class, _temp;
10
11 return _temp = _class = function (_React$Component) {
12 _inherits(WrappedComp, _React$Component);
13
14 function WrappedComp() {
15 _classCallCheck(this, WrappedComp);
16
17 return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));
18 }
19
20 WrappedComp.prototype.render = function render() {
21 return React.createElement(Radio, _extends({}, this.props, { context: this.context }));
22 };
23
24 return WrappedComp;
25 }(React.Component), _class.displayName = 'Radio', _class.contextTypes = {
26 onChange: PropTypes.func,
27 __group__: PropTypes.bool,
28 isButton: PropTypes.bool,
29 selectedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.bool]),
30 disabled: PropTypes.bool
31 }, _temp;
32}
\No newline at end of file