1
|
"use strict";
|
2
|
|
3
|
exports.__esModule = true;
|
4
|
|
5
|
var _for = require("../core-js/symbol/for");
|
6
|
|
7
|
var _for2 = _interopRequireDefault(_for);
|
8
|
|
9
|
var _symbol = require("../core-js/symbol");
|
10
|
|
11
|
var _symbol2 = _interopRequireDefault(_symbol);
|
12
|
|
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
14
|
|
15
|
exports.default = function () {
|
16
|
var REACT_ELEMENT_TYPE = typeof _symbol2.default === "function" && _for2.default && (0, _for2.default)("react.element") || 0xeac7;
|
17
|
return function createRawReactElement(type, props, key, children) {
|
18
|
var defaultProps = type && type.defaultProps;
|
19
|
var childrenLength = arguments.length - 3;
|
20
|
|
21
|
if (!props && childrenLength !== 0) {
|
22
|
props = {};
|
23
|
}
|
24
|
|
25
|
if (props && defaultProps) {
|
26
|
for (var propName in defaultProps) {
|
27
|
if (props[propName] === void 0) {
|
28
|
props[propName] = defaultProps[propName];
|
29
|
}
|
30
|
}
|
31
|
} else if (!props) {
|
32
|
props = defaultProps || {};
|
33
|
}
|
34
|
|
35
|
if (childrenLength === 1) {
|
36
|
props.children = children;
|
37
|
} else if (childrenLength > 1) {
|
38
|
var childArray = Array(childrenLength);
|
39
|
|
40
|
for (var i = 0; i < childrenLength; i++) {
|
41
|
childArray[i] = arguments[i + 3];
|
42
|
}
|
43
|
|
44
|
props.children = childArray;
|
45
|
}
|
46
|
|
47
|
return {
|
48
|
$$typeof: REACT_ELEMENT_TYPE,
|
49
|
type: type,
|
50
|
key: key === undefined ? null : '' + key,
|
51
|
ref: null,
|
52
|
props: props,
|
53
|
_owner: null
|
54
|
};
|
55
|
};
|
56
|
}();
|