UNPKG

fomantic-ui-react

Version:

Fomantic-UI React -- A React Component Library.

34 lines (26 loc) 1.17 kB
/** * fomantic-ui-react v0.0.1-alpha.10 * (c) 2022 FireLoong <fireloong@foxmail.com> * @license MIT */ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var React = require('react'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var React__default = /*#__PURE__*/_interopDefaultLegacy(React); var isValidElement = React__default["default"].isValidElement; var replaceElement = function replaceElement(element, replacement, props) { if (!isValidElement(element)) return replacement; return /*#__PURE__*/React__default["default"].cloneElement(element, typeof props === "function" ? props(element.props || {}) : props); }; var cloneElement = function cloneElement(element, props) { return replaceElement(element, element, props); }; var isNil = function isNil(children) { return children === null || children === void 0 || Array.isArray(children) && children.length === 0; }; exports.cloneElement = cloneElement; exports.isNil = isNil; exports.isValidElement = isValidElement; exports.replaceElement = replaceElement; //# sourceMappingURL=reactNode.js.map