createApp

Used to create custom entries, custom runtime plugins. This API is only required when using Custom App.

Usage

import { createApp } from '@modern-js/runtime';

Function Signature

import type { Plugin } from '@modern-js/runtime';

function createApp(options: { plugins: Plugin[] }): React.ComponentType<any>;

Input

  • options: optional configuration.
    • plugins: custom plugin extensions.

Example

Create Custom Entry

For details, see bootstrap.

Custom Plugins

import { createApp } from '@modern-js/runtime';

function App() {
  return <div>app</div>;
}

export default createApp({
  plugins: [customPlugin()],
})(App);