DEV Community

GuyLearningReact
GuyLearningReact

Posted on • Edited on

Sharing context across Microfrontends

TLDR; How to pass Context to Microfrontends?
The application is divided into multiple Microfrontends or react apps. Each of this is running in a different port.
Container is hosting other Micrfrontends.
Each one is a separate react app and it is a runtime integration.

Currently passing some parameters via URL to other Microfrontends.

Need to pass the data across these react apps (MFEs) using React Context.

Defined ReactContext Provider in Container (ReactApp1) and stored value (say color=black).

To access this color inside the lower level Microfrontend (ReactApp2) we need the context to be available. How to make it available?

Top comments (1)

Collapse
 
mallikg2k profile image
GuyLearningReact

Experts, Please respond.