Skip to content

Allow hydrating reflex app into existing container #6304

@masenf

Description

@masenf

Describe the Features
Instead of hydrating the full document, we render into a specific DOM element (createRoot on a container div, falling back to hydrateRoot on document). We replaced the Html > Head > Body document structure with a Main element for SPA embedding. Ideally Reflex would support a config option to mount into a target container element.

  • What is the purpose of the feature?
    Allow reflex to be embedded in existing HTML documents by specifying a container id.

  • Show an example / use cases for the new feature.

rx.Config(
    name="myapp",
    hydrate_root="#reflex-container",
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestA feature you wanted added to reflex

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions