Jennifer Fu
1 min readSep 13, 2020

--

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.

--

--

Jennifer Fu
Jennifer Fu

Responses (1)