Thanks, Jiahua!

The principle of micro frontends is decouple, i.e. ideally they do not share states. However, in reality, things need to be shared.

We use global ways to share the state.

* Global objects: In renderCreatereactapp, we can pass in a list of global variables to each micro frontend to be shared.

* Window objects: window.variables can be used to share the variables in a global scope.

* Local storage: Local storage is another way to share things globally.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store