Skip to main content

Module container

Module container 

Source
Expand description

React Container Component

Provides a Dioxus component for mounting React applications using a folder asset + manifest pattern. The build step generates metadata.json describing the output files, and ReactApp reads it to load the correct CSS/JS chunks — no manual renaming or copying needed.

§Breaking Changes (0.2.0)

  • Removed ReactContainer (single bundle.js only)
  • ReactApp now uses dir (folder asset) + manifest (ReactManifest) instead of individual bundle / stylesheet asset props

§Usage

const REACT_DIR: Asset = asset!("/assets/react");

// Parse metadata.json at compile time
let manifest = ReactManifest::from_json(
    include_str!("../assets/react/metadata.json")
).expect("invalid metadata.json");

rsx! {
    ReactApp {
        dir: REACT_DIR,
        manifest: manifest,
        bridge: bridge,
    }
}

Re-exports§

pub use ReactApp_completions::Component::ReactApp;

Structs§

ReactAppProps
Properties for the ReactApp component.
ReactManifest
Build manifest describing the React app’s output files.

Functions§

ReactApp
React application container — loads a React app from a folder asset + manifest.