1 | var _Symbol$for = require("@babel/runtime-corejs2/core-js/symbol/for");
|
2 |
|
3 | var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
|
4 |
|
5 | var REACT_ELEMENT_TYPE;
|
6 |
|
7 | function _createRawReactElement(type, props, key, children) {
|
8 | if (!REACT_ELEMENT_TYPE) {
|
9 | REACT_ELEMENT_TYPE = typeof _Symbol === "function" && _Symbol$for && _Symbol$for("react.element") || 0xeac7;
|
10 | }
|
11 |
|
12 | var defaultProps = type && type.defaultProps;
|
13 | var childrenLength = arguments.length - 3;
|
14 |
|
15 | if (!props && childrenLength !== 0) {
|
16 | props = {
|
17 | children: void 0
|
18 | };
|
19 | }
|
20 |
|
21 | if (childrenLength === 1) {
|
22 | props.children = children;
|
23 | } else if (childrenLength > 1) {
|
24 | var childArray = new Array(childrenLength);
|
25 |
|
26 | for (var i = 0; i < childrenLength; i++) {
|
27 | childArray[i] = arguments[i + 3];
|
28 | }
|
29 |
|
30 | props.children = childArray;
|
31 | }
|
32 |
|
33 | if (props && defaultProps) {
|
34 | for (var propName in defaultProps) {
|
35 | if (props[propName] === void 0) {
|
36 | props[propName] = defaultProps[propName];
|
37 | }
|
38 | }
|
39 | } else if (!props) {
|
40 | props = defaultProps || {};
|
41 | }
|
42 |
|
43 | return {
|
44 | $$typeof: REACT_ELEMENT_TYPE,
|
45 | type: type,
|
46 | key: key === undefined ? null : '' + key,
|
47 | ref: null,
|
48 | props: props,
|
49 | _owner: null
|
50 | };
|
51 | }
|
52 |
|
53 | module.exports = _createRawReactElement; |
\ | No newline at end of file |