Skip to content

feat: streamline vinext + module-federation/vite #533

@gioboa

Description

@gioboa

Hi, congratulations for this amazing project. 👏

I created an example using @module-federation/vite, and everything works fine. Here is the code

However, I ran into the problem of having multiple react instances at runtime.
I found a workaround, the idea is to have a method that exposes the host react instance for consumers.

I took inspiration from the Nuxt API useNuxtApp.
With Nuxt, for example, you can use const { $pinia } = useNuxtApp(); to retrieve the unique state instance and use that one inside multiple applications.

Would you mind thinking about a public API to support this scenario?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions