or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-4/

Container-Aware Micro App

Create a simple React micro-frontend that can run standalone or inside a single-spa/qiankun style host, targeting a provided container when available and passing host props into the rendered view.

Capabilities

Reuses provided single-spa container

  • With the single-spa flag enabled and a host container containing an element with id ice-container, mounting renders the app into that element and displays the customProps.message text. @test

Creates container when missing

  • With the single-spa flag enabled and a host container lacking #ice-container, mounting creates that child element, appends it to the host container, and renders the app content showing customProps.message. @test

Standalone guard

  • When mounted without host container metadata, the app renders only once to a default root and avoids double-mounting on repeated mount calls. @test

Unmount cleanup

  • Calling unmount removes the rendered content/root from whichever container was used so a subsequent mount recreates a clean tree. @test

Implementation

@generates

API

export interface MicroAppOptions {
  container?: Element;
  customProps?: Record<string, any>;
  singleSpa?: boolean;
}

export async function bootstrap(options?: MicroAppOptions): Promise<void>;
export async function mount(options?: MicroAppOptions): Promise<void>;
export async function unmount(options?: MicroAppOptions): Promise<void>;

Dependencies { .dependencies }

@ice/plugin-icestark { .dependency }

Provides micro-frontend runtime integration with host containers, including single-spa/qiankun compatibility for container-targeted rendering.