WaspW
Wasp2y ago
Kantros

Lazy Loading React Components

When making a large application it is best practice to lazy load components as needed. It seems there is no way to lazy load a route in wasp?

route AnotherRoute { path: "/test", to: AnotherRoute }
page AnotherRoute {
  component: import { AnotherRoute} from "@src/client/AnotherRoute",
}



I have this route definition. It is in the JS bundle even though I have never navigated to it. This would be an issue as the application grows in size, when a user navigates to the landing page, they will need to download the ENTIRE app.

Does WASP have a way to lazy load components using the build in routing?
Was this page helpful?