@folo/withcontext
Version:
micro HOC compose component accepts custom context values as props
3 lines (2 loc) • 542 B
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.foloWithcontext=t(e.react)}(this,function(e){"use strict";return function(t){var n=t.Component,o=t.Consumer,r=t.contextProps,c=void 0===r?[]:r;return function(t){return e.createElement(o,null,function(o){var r=c.length>0?{}:o;return c.length>0&&c.forEach(function(e){r[e]=o[e]}),e.createElement(n,Object.assign({},t,r))})}}});
//# sourceMappingURL=foloWithcontext.min.umd.js.map