source: trip-planner-front/node_modules/@babel/helpers/lib/helpers/jsx.js@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = _createRawReactElement;
7var REACT_ELEMENT_TYPE;
8
9function _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}
Note: See TracBrowser for help on using the repository browser.