reactant-ssr
Version:
A server-side renderer for Reactant
2 lines (1 loc) • 2.02 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("reactant"),require("react")):"function"==typeof define&&define.amd?define(["exports","reactant","react"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).reactantSsr={},t.reactant,t.React)}(this,(function(t,e,r){"use strict";var n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)};var o=function(){return o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},o.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var p=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.component=function(t){var e=t.Component,n=t.pageProps;return r.createElement(e,o({},n))},e}(e.ViewModule);t.AppView=p,t.createServerApp=function(t){var n,c=e.createApp(o(o({},t),{main:null!==(n=t.main)&&void 0!==n?n:p,render:function(t){return t}})),a=c.bootstrap,u=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]])}return r}(c,["bootstrap"]);return o({bootstrap:function(t){return a((function(e){return r.createElement(e,o({},t))}))}},u)},Object.keys(e).forEach((function(r){"default"===r||Object.prototype.hasOwnProperty.call(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}))}));