UNPKG

hel-tpl-remote-react-comps

Version:

最简单的远程react组件模板 codesandbox: https://codesandbox.io/s/demo-load-remote-react-comp-2bnpl0?file=/src/App.js

3 lines 2.27 kB
/*! For license information please see 484.01eb6278.chunk.js.LICENSE.txt */ "use strict";(self["helJsonp_hel-tpl-remote-react-comps_1691540620825"]=self["helJsonp_hel-tpl-remote-react-comps_1691540620825"]||[]).push([[484],{936:function(e,r,o){o.r(r),o.d(r,{HelloRemoteReactComp:function(){return i}});var t=o(363),n=o.n(t);var l=o.p+"static/media/logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg",c=o(184),i=n().forwardRef((function(e,r){return n().useImperativeHandle(r,(function(){return{sayHello:function(){alert("Hello hel-micro")}}})),(0,c.jsx)("div",{className:"App",children:(0,c.jsxs)("header",{className:"App-header",children:[(0,c.jsx)("img",{src:l,className:"App-logo",alt:"logo"}),(0,c.jsxs)("p",{children:[(0,c.jsx)("h1",{children:"This is a hel remote react component"}),(0,c.jsx)("h2",{children:"emitted by hel-micro"})]}),(0,c.jsx)("a",{className:"App-link",href:"https://tnfe.github.io/hel",target:"_blank",rel:"noopener noreferrer",children:"Learn hel-micro"})]})})}))},484:function(e,r,o){o.r(r);o(363);var t=o(533),n=o.n(t),l=o(936),c=o(184);var i={NODE_ENV:"production",PUBLIC_URL:"https://unpkg.com/hel-tpl-remote-react-comps@1.3.3/hel_dist",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_COMP_TYPE,s=void 0===i?"HelloRemoteReactComp":i,a=l[s]||function(){return(0,c.jsxs)("h1",{children:["comp ",s," not defined"]})};n().render((0,c.jsx)(a,{}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"root",r=document.getElementById(e);return r||((r=document.createElement("div")).id=e,document.body.appendChild(r)),r}("root"))},374:function(e,r,o){var t=o(363),n=Symbol.for("react.element"),l=Symbol.for("react.fragment"),c=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function a(e,r,o){var t,l={},a=null,d=null;for(t in void 0!==o&&(a=""+o),void 0!==r.key&&(a=""+r.key),void 0!==r.ref&&(d=r.ref),r)c.call(r,t)&&!s.hasOwnProperty(t)&&(l[t]=r[t]);if(e&&e.defaultProps)for(t in r=e.defaultProps)void 0===l[t]&&(l[t]=r[t]);return{$$typeof:n,type:e,key:a,ref:d,props:l,_owner:i.current}}r.jsx=a,r.jsxs=a},184:function(e,r,o){e.exports=o(374)}}]); //# sourceMappingURL=484.01eb6278.chunk.js.map