react-microfrontend-patterns

Configure shared React runtimes, schema-driven forms, and Zustand state across Vite bundles.

10|11|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/microsoft/amplifier-bundle-skills --skill react-microfrontend-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: react-microfrontend-patterns
Source: https://github.com/microsoft/amplifier-bundle-skills/tree/main/skills/react-microfrontend-patterns
Command: npx skills add https://github.com/microsoft/amplifier-bundle-skills --skill react-microfrontend-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build React systems where multiple independently deployed bundles must share one React instance at runtime, while also supporting dynamic schema-driven forms and durable browser state.

Core Features & Use Cases

  • Shared React Runtime: Use import maps and Vite externalization to avoid the dual-React-instance hook failure in multi-bundle frontends.
  • Dynamic Form Architectures: Render server-driven schemas into React UIs and refine form behavior based on user actions.
  • Persistent Client State: Manage browser state with Zustand and localStorage sync, including Map-based collections and controlled event history.
  • Autocomplete Ranking: Implement frecency-based suggestion ordering with recency decay for better field completion behavior.
  • Use Case: A product team ships several independently built React modules into one host app and needs them to work together reliably without breaking hooks or losing user state.

Quick Start

Ask the Skill to design a shared-React frontend architecture for multiple Vite bundles with schema-driven forms, frecency autocomplete, and Zustand persistence.

Frequently Asked Questions about react-microfrontend-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do React hooks break in a microfrontend with multiple independently built bundles?

React hooks break in a microfrontend when multiple independently built bundles load separate React instances at runtime. Sharing one React instance via import maps and Vite externalization resolves this dual-React-instance hook failure.

How do I externalize React in Vite to share a single runtime across microfrontends?

To share a single React runtime across microfrontends, externalize React in Vite configuration and map it to a shared CDN or host URL via import maps. This ensures all independently built front-end bundles reference one React instance.

Can I persist Zustand state to localStorage and sync it across multiple browser tabs?

Yes, you can persist Zustand state to localStorage and synchronize it across tabs. This persistent client state management requires Zustand localStorage hydration to maintain Map-based collections and controlled event history across reloads.

What is frecency-based autocomplete and how does it rank form field suggestions?

Frecency-based autocomplete ranks form field suggestions by combining frequency and recency decay scoring. This scoring logic improves field completion behavior by prioritizing recently and frequently used entries in dynamic schema-driven interfaces.

How do I render dynamic forms from server-driven schemas in a shared React bundle?

Dynamic forms render from server-driven schemas into React UIs within a shared React bundle architecture. The system refines form behavior based on user actions using field-key grouping to manage multi-bundle front-end production behavior.

Does this shared React approach work without import maps?

No, this shared React approach requires import maps alongside Vite externalization to function correctly. Without import maps to coordinates module sharing, independently deployed bundles cannot reliably prevent dual-React-instance hook failures.