UNPKG

react-render-callback

Version:

render-prop helper to render anything (Functions, Components, Elements, ...)

3 lines (2 loc) 1.37 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.ReactRenderCallback=t(e.React)}(this,function(e){"use strict";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var n=function(e){return function(e){return null==e||!1===e||!0===e}(e)?null:e},r="function"==typeof e.createContext&&e.createContext(),o=r&&r.Provider.$$typeof,f=r&&r.Consumer.$$typeof,u="function"==typeof e.forwardRef&&e.forwardRef(function(e,t){return{props:e,ref:t}}).$$typeof,c=function(r,c){return function(e){if(null==e)return!1;var t=typeof e;return"string"!==t&&("function"===t?!(!e.prototype||!e.prototype.isReactComponent):"object"===t&&e.$$typeof&&(e.$$typeof===o||e.$$typeof===f||e.$$typeof===u))}(r)?function(t){return e.createElement(r,t)}:"function"==typeof r?function(){return n(r.defaultProps?r(t({},r.defaultProps,arguments.length<=0?void 0:arguments[0])):r.apply(void 0,arguments))}:c&&c.cloneElement&&e.isValidElement(r)?function(t){return e.cloneElement(r,t)}:(i=n(r),function(){return i});var i},i=function(e,t,n){return c(e,n)(t)};return i.createRender=c,i}); //# sourceMappingURL=react-render-callback.umd.min.js.map