Skip to content

Instantly share code, notes, and snippets.

@av1v3k
Created April 4, 2026 14:09
Show Gist options
  • Select an option

  • Save av1v3k/0e445feaae794b29bd6a5a72838e392a to your computer and use it in GitHub Desktop.

Select an option

Save av1v3k/0e445feaae794b29bd6a5a72838e392a to your computer and use it in GitHub Desktop.
Container App rendering the sub app/MFE app - for Microfrontend
// Any Sub App/MFE imported into the Container
export default () => {
const ref = useRef(null);
useEffect(() => {
mount(ref.current);
});
return <div ref={ref} />;
};
// container Main Component
export default () => {
return (
<div>
<h1>Hi there!</h1>
<hr />
<MFEApp1 />
</div>
);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment