Skip to content

Latest commit

 

History

History
 
 

react-18-code-splitting

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

React 18 Code Splitting

This example demonstrates how to use Code Splitting with React 18.

  • app1 This app consumes the Content component from app2 and uses React.lazy to load it.
  • app2This app exposes the Content component and split it into a separate chunk using React.lazy.

The app2 is used to expose a component called Content and a route called userRoute.

Running Demo

Run yarn to install the dependencies.

Run pnpm run start this will build and start all applications.

Bellow you can see the port mapping: