Open DB-Alex opened 5 years ago
There's no way to do it with React.lazy (yet), but it's possible to load components/routes asynchronously within your routes, and pass them to your component as view props.
E.g. using Navi's lazy
function:
import { lazy, mount } from 'navi'
export default mount({
'/': lazy(() => import('./landingRoutes')),
'/blog': lazy(() => import('./blogRoutes')),
})
@jamesknelson Does lazy
loading a route imply webpack will chunk it?
Is there a minimal viable example of webpack, typescript, react-navi with automatic chunking by chance?
Is it already possible to lazy load components using navi?
This now throws:
Is there another way to archive this with navi?