createApp

WARNING

Soon to be deprecated, it is recommended to use createRoot.

Used for creating custom entries and customizing runtime plugins.

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);