@ailjc/micro-sub
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

@micro-web/sub

@ailjc/micro-app 微应用解决方案 子应用定义

Install

pnpm i @ailjc/micro-sub

Useage

import { defineMicroApp } from '@ailjc/micro-sub';
import App, { AppProps } from './App';

export default defineMicroApp(container => {
  function render(props: AppProps) {
    ReactDOM.render(<App {...props} />, container);
  }
  return {
    mount: render,
    render: render,
    unmount() {
      ReactDOM.unmountComponentAtNode(container);
    },
  };
});

Package Sidebar

Install

npm i @ailjc/micro-sub

Weekly Downloads

0

Version

0.3.0

License

MIT

Unpacked Size

2.14 kB

Total Files

6

Last publish

Collaborators

  • lujingce