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