jsx.js 1009 B

1234567891011121314151617181920212223242526
  1. var REACT_ELEMENT_TYPE;
  2. export default function _createRawReactElement(type, props, key, children) {
  3. REACT_ELEMENT_TYPE || (REACT_ELEMENT_TYPE = "function" == typeof Symbol && Symbol["for"] && Symbol["for"]("react.element") || 60103);
  4. var defaultProps = type && type.defaultProps,
  5. childrenLength = arguments.length - 3;
  6. if (props || 0 === childrenLength || (props = {
  7. children: void 0
  8. }), 1 === childrenLength) props.children = children;else if (childrenLength > 1) {
  9. for (var childArray = new Array(childrenLength), i = 0; i < childrenLength; i++) {
  10. childArray[i] = arguments[i + 3];
  11. }
  12. props.children = childArray;
  13. }
  14. if (props && defaultProps) for (var propName in defaultProps) {
  15. void 0 === props[propName] && (props[propName] = defaultProps[propName]);
  16. } else props || (props = defaultProps || {});
  17. return {
  18. $$typeof: REACT_ELEMENT_TYPE,
  19. type: type,
  20. key: void 0 === key ? null : "" + key,
  21. ref: null,
  22. props: props,
  23. _owner: null
  24. };
  25. }