Skip to content

Federated React app setup with routing and state across remotes

Notifications You must be signed in to change notification settings

crshmk/module-federation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A federated React app; host with two remotes

  • shared state using context
  • nested routing
  • css modules and images

1.)

mv .sample-env .env

set env values

2.) set server information (domain / server path to remote bundles)

  • host/src/index.html <script> tags

3.)

# local 
npm start

# prod 
npm run build

CLI

npm run create-remote DashboardPage
npm run show-ports

Note:

  • The nav list styling changes when the /img route is accessed, and that styling persists after navigating away from /img.

  • On subsequent routing to /img, the image is fetched or not when the browser cache is disabled or active, respectively.


Bonus features:

  • No Typescript

About

Federated React app setup with routing and state across remotes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published