diff --git a/dist/react-status-manager.js b/dist/react-status-manager.js index c647cf1..23eb225 100644 --- a/dist/react-status-manager.js +++ b/dist/react-status-manager.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("classnames"),require("prop-types"),require("react")):"function"==typeof define&&define.amd?define(["classnames","prop-types","react"],t):"object"==typeof exports?exports.ReactStatusManager=t(require("classnames"),require("prop-types"),require("react")):e.ReactStatusManager=t(e.classnames,e["prop-types"],e.react)}(this,function(e,t,r){return function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="/",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=r(1),a=n(o);t.default=a.default},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=Object.assign||function(e){for(var t=1;t= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _default = function (_Component) {\n\t _inherits(_default, _Component);\n\t\n\t function _default() {\n\t _classCallCheck(this, _default);\n\t\n\t return _possibleConstructorReturn(this, (_default.__proto__ || Object.getPrototypeOf(_default)).apply(this, arguments));\n\t }\n\t\n\t _createClass(_default, [{\n\t key: 'render',\n\t value: function render() {\n\t var _props = this.props,\n\t className = _props.className,\n\t status = _props.status,\n\t statusList = _props.statusList,\n\t children = _props.children,\n\t nodeName = _props.nodeName,\n\t props = _objectWithoutProperties(_props, ['className', 'status', 'statusList', 'children', 'nodeName']);\n\t\n\t return (0, _react.createElement)(nodeName, _extends({\n\t 'data-status': status,\n\t children: this.children\n\t }, props));\n\t }\n\t }, {\n\t key: 'children',\n\t\n\t /*===properties end===*/\n\t\n\t /*===properties start===*/\n\t get: function get() {\n\t var _props2 = this.props,\n\t status = _props2.status,\n\t children = _props2.children,\n\t statusList = _props2.statusList;\n\t\n\t return children.map(function (child, index) {\n\t return status === statusList[index] ? child : null;\n\t });\n\t }\n\t }]);\n\t\n\t return _default;\n\t}(_react.Component);\n\t\n\t_default.propTypes = {\n\t className: _propTypes2.default.string,\n\t statusList: _propTypes2.default.array,\n\t status: _propTypes2.default.any,\n\t nodeName: _propTypes2.default.any\n\t};\n\t_default.defaultProps = {\n\t statusList: [],\n\t nodeName: 'div'\n\t};\n\texports.default = _default;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// react-status-manager.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 9a76718d6284da38994b","import ReactStatusManager from 'components/react-status-manager';\nexport default ReactStatusManager;\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","import { Component, createElement } from 'react';\n\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport default class extends Component {\n /*===properties start===*/\n static propTypes = {\n className: PropTypes.string,\n statusList: PropTypes.array,\n status: PropTypes.any,\n nodeName: PropTypes.any\n };\n\n static defaultProps = {\n statusList: [],\n nodeName: 'div'\n };\n /*===properties end===*/\n\n get children(){\n const { status, children, statusList } = this.props;\n return children.map((child, index) => {\n return status === statusList[index] ? child : null;\n });\n }\n\n render() {\n const { className, status, statusList, children, nodeName, ...props } = this.props;\n return createElement(nodeName,{\n 'data-status': status,\n children: this.children,\n ...props\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/react-status-manager.js","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"classnames\"\n// module id = 2\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"prop-types\"\n// module id = 3\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 4\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-status-manager.js","webpack:///webpack/bootstrap 1e9f25882a33641c204e","webpack:///./src/main.js","webpack:///external \"react\"","webpack:///./src/components/react-status-manager.js","webpack:///external \"classnames\"","webpack:///external \"prop-types\""],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_3__","__WEBPACK_EXTERNAL_MODULE_4__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_interopRequireDefault","obj","__esModule","default","Object","defineProperty","value","_reactStatusManager","_reactStatusManager2","ReactStatusManager","React","_objectWithoutProperties","keys","target","i","indexOf","prototype","hasOwnProperty","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","create","constructor","enumerable","writable","configurable","setPrototypeOf","__proto__","undefined","_extends","assign","arguments","length","source","key","_createClass","defineProperties","props","descriptor","protoProps","staticProps","_react","_propTypes","_propTypes2","_classnames","_default","_Component","getPrototypeOf","apply","_props","status","className","nodeName","statusList","children","createElement","data-status","get","_props2","map","child","index","Component","propTypes","PropTypes","string","array","any","defaultProps","Fragment"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,SAAAA,QAAA,cAAAA,QAAA,eACA,kBAAAC,gBAAAC,IACAD,QAAA,mCAAAJ,GACA,gBAAAC,SACAA,QAAA,mBAAAD,EAAAG,QAAA,SAAAA,QAAA,cAAAA,QAAA,eAEAJ,EAAA,mBAAAC,EAAAD,EAAA,MAAAA,EAAA,WAAAA,EAAA,gBACCO,KAAA,SAAAC,EAAAC,EAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAX,OAGA,IAAAC,GAAAW,EAAAD,IACAX,WACAa,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI,KAAAd,EAAAD,QAAAC,IAAAD,QAAAU,GAGAT,EAAAa,QAAA,EAGAb,EAAAD,QAvBA,GAAAY,KAqCA,OATAF,GAAAM,EAAAP,EAGAC,EAAAO,EAAAL,EAGAF,EAAAQ,EAAA,IAGAR,EAAA,KDgBM,SAAUT,EAAQD,EAASU,GAEhC,YAUA,SAASS,GAAuBC,GAAO,MAAOA,IAAOA,EAAIC,WAAaD,GAAQE,QAASF,GARvFG,OAAOC,eAAexB,EAAS,cAC7ByB,OAAO,GE3DV,IAAAC,GA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iB,aJwJ5BjB,GItJQkB,WACLZ,UAAWa,UAAUC,OACrBZ,WAAYW,UAAUE,MACtBhB,OAAQc,UAAUG,IAClBf,SAAUY,UAAUG,KJwJvBtB,EIrJQuB,cACLf,cACAD,SAAUjD,EAAMkE,UAAY,OJuJ/B/F,EAAQsB,QAAUiD,IACWxD,KAAKf,EAASU,EAAoB,KAI1D,SAAUT,EAAQD,GK5KxBC,EAAAD,QAAAO,GLkLM,SAAUN,EAAQD,GMlLxBC,EAAAD,QAAAQ","file":"react-status-manager.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"classnames\"), require(\"prop-types\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"classnames\", \"prop-types\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactStatusManager\"] = factory(require(\"react\"), require(\"classnames\"), require(\"prop-types\"));\n\telse\n\t\troot[\"ReactStatusManager\"] = factory(root[\"react\"], root[\"classnames\"], root[\"prop-types\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"classnames\"), require(\"prop-types\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"classnames\", \"prop-types\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactStatusManager\"] = factory(require(\"react\"), require(\"classnames\"), require(\"prop-types\"));\n\telse\n\t\troot[\"ReactStatusManager\"] = factory(root[\"react\"], root[\"classnames\"], root[\"prop-types\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_4__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"/\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _reactStatusManager = __webpack_require__(2);\n\t\n\tvar _reactStatusManager2 = _interopRequireDefault(_reactStatusManager);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\texports.default = _reactStatusManager2.default;\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(React) {'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.default = undefined;\n\t\n\tvar _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _react = __webpack_require__(1);\n\t\n\tvar _propTypes = __webpack_require__(4);\n\t\n\tvar _propTypes2 = _interopRequireDefault(_propTypes);\n\t\n\tvar _classnames = __webpack_require__(3);\n\t\n\tvar _classnames2 = _interopRequireDefault(_classnames);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\tvar _default = function (_Component) {\n\t _inherits(_default, _Component);\n\t\n\t function _default() {\n\t _classCallCheck(this, _default);\n\t\n\t return _possibleConstructorReturn(this, (_default.__proto__ || Object.getPrototypeOf(_default)).apply(this, arguments));\n\t }\n\t\n\t _createClass(_default, [{\n\t key: 'render',\n\t value: function render() {\n\t var _props = this.props,\n\t className = _props.className,\n\t status = _props.status,\n\t statusList = _props.statusList,\n\t children = _props.children,\n\t nodeName = _props.nodeName,\n\t props = _objectWithoutProperties(_props, ['className', 'status', 'statusList', 'children', 'nodeName']);\n\t\n\t return (0, _react.createElement)(nodeName, _extends({\n\t 'data-status': status,\n\t children: this.children\n\t }, props));\n\t }\n\t }, {\n\t key: 'children',\n\t\n\t /*===properties end===*/\n\t\n\t /*===properties start===*/\n\t get: function get() {\n\t var _props2 = this.props,\n\t status = _props2.status,\n\t children = _props2.children,\n\t statusList = _props2.statusList;\n\t\n\t return children.map(function (child, index) {\n\t return status === statusList[index] ? child : null;\n\t });\n\t }\n\t }]);\n\t\n\t return _default;\n\t}(_react.Component);\n\t\n\t_default.propTypes = {\n\t className: _propTypes2.default.string,\n\t statusList: _propTypes2.default.array,\n\t status: _propTypes2.default.any,\n\t nodeName: _propTypes2.default.any\n\t};\n\t_default.defaultProps = {\n\t statusList: [],\n\t nodeName: React.Fragment || 'div'\n\t};\n\texports.default = _default;\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// react-status-manager.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 1e9f25882a33641c204e","import ReactStatusManager from 'components/react-status-manager';\nexport default ReactStatusManager;\n\n\n\n// WEBPACK FOOTER //\n// ./src/main.js","module.exports = __WEBPACK_EXTERNAL_MODULE_1__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"react\"\n// module id = 1\n// module chunks = 0","import { Component, createElement } from 'react';\n\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\nexport default class extends Component {\n /*===properties start===*/\n static propTypes = {\n className: PropTypes.string,\n statusList: PropTypes.array,\n status: PropTypes.any,\n nodeName: PropTypes.any\n };\n\n static defaultProps = {\n statusList: [],\n nodeName: React.Fragment || 'div'\n };\n /*===properties end===*/\n\n get children(){\n const { status, children, statusList } = this.props;\n return children.map((child, index) => {\n return status === statusList[index] ? child : null;\n });\n }\n\n render() {\n const { className, status, statusList, children, nodeName, ...props } = this.props;\n return createElement(nodeName,{\n 'data-status': status,\n children: this.children,\n ...props\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/components/react-status-manager.js","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"classnames\"\n// module id = 3\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_4__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"prop-types\"\n// module id = 4\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file diff --git a/src/components/react-status-manager.js b/src/components/react-status-manager.js index 99015d4..4b2cfc8 100644 --- a/src/components/react-status-manager.js +++ b/src/components/react-status-manager.js @@ -14,7 +14,7 @@ export default class extends Component { static defaultProps = { statusList: [], - nodeName: 'div' + nodeName: React.Fragment || 'div' }; /*===properties end===*/