Created
April 4, 2026 14:09
-
-
Save av1v3k/0e445feaae794b29bd6a5a72838e392a to your computer and use it in GitHub Desktop.
Container App rendering the sub app/MFE app - for Microfrontend
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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