These docs cover qiankun 3.0 (RC) — install it with npm i qiankun@rc. For 2.x, see the v2 docs.
Skip to content

start

Start the route-driven applications registered with registerMicroApps. After it runs, single-spa mounts and unmounts apps automatically by comparing the current URL with each app's activeRule.

You do not call start() when using loadMicroApp directly.

Signature

ts
function start(opts?: StartOpts): void;

StartOpts comes from single-spa:

OptionTypeDefaultDescription
urlRerouteOnlybooleantrueWhen true, reroute only after the URL actually changes.

Usage

ts
import { registerMicroApps, start } from 'qiankun';

registerMicroApps([
  {
    name: 'sub-app',
    entry: '//localhost:7101',
    container: document.getElementById('subapp-container')!,
    activeRule: '/sub-app',
  },
]);

start();

start() is idempotent; repeated calls do not start routing again.

Relationship to loadMicroApp

loadMicroApp ensures the runtime is ready, so on-demand loading requires no separate startup call. Only route-driven registration requires an explicit start().

When migrating from qiankun 2.x, do not continue passing sandbox, prefetch, or fetch configuration to start(). See the migration guide for the complete changes.

Released under the MIT License.