Reputation: 1
Does anyone tried to put Vue app into React project using module federation and vite? My vue app uses vuetify and yandex maps what gives me multiple problems. I thought component will be fully independant and I will just put it into react but no. I have problems with initializing maps in the react (but in vue it is working well), and vuetify. How to implement it in the react or avoid it at all?
import MapApp from "map-mfe/App";
import { createApp } from "vue";
import { useEffect } from "react";
import { createVuetify } from 'vuetify'
import { createYmaps } from 'vue-yandex-maps'
import 'vuetify/dist/vuetify.min.css'
const VueMapApp = () => {
useEffect(() => {
const app = createApp(MapApp)
app.use(createYmaps({ apikey: "my-api" }))
app.use(createVuetify())
app.mount("#vue-app")
return () => app.unmount()
}, [])
return <div id="vue-app"></div>
}
export default VueMapApp
In the code above I am trying to put Vue component into react, but still getting "Uncaught (in promise) YandexMapException: You have set up component without initializing Yandex maps. Please check initializeOn setting or call initYmaps manually before registering this component."
Upvotes: 0
Views: 219