Within my micro-frontend project, each individual project has its own Redux and state configuration.
When I export the project without Redux, it works, displaying 'Hello world!' on the screen. However, when I add the provider, I encounter an error.
Host
import React, { Suspense } from "react";
import ReactDOM from "react-dom/client";
import { BuildePage } from "builder/pages";
ReactDOM.createRoot(document.getElementById("root")!).render(
<React.StrictMode>
<Suspense>
<BuilderPage />
</Suspense>
</React.StrictMode>
);
Remote
import { Provider } from 'react-redux';
import { store } from '@/store';
const BuilderPage = () => {
return (
<Provider store={store}>
<span>Hello world!</span>
</Provider>
);
};
export default BuilderPage;
Errors
Uncaught TypeError: Cannot read properties of null (reading 'useMemo')