Best way to structure React Router in a large Laravel + React SSR project (60+ pages)?

Wait 5 sec.

Hey everyone, I'm working on a large project using React with server-side rendering through Laravel. My frontend has 60+ pages, and every route has its own dedicated page component. I'm currently using React Router with lazy-loaded routes (lazy() / Suspense), conditional routes, and route groups. However, I'm noticing that as I navigate through the application and use more pages, it gradually becomes slower and eventually starts feeling laggy. I expected lazy loading to prevent unnecessary components from loading until they're needed, but it seems like more and more things are being loaded over time. I'm wondering: What's the best way to structure React Router in a large Laravel SSR project? Is having 60+ individual page components and routes a problem? Should I organize routes into separate modules or route groups? Is it normal for lazy-loaded components to remain in memory after navigation? How should conditional routes and nested layouts be handled efficiently? What could cause performance degradation after navigating through multiple pages? I'd really appreciate hearing how you structure React Router in large production applications, especially with Laravel SSR. Thanks!   submitted by   /u/Front-Release-1238   to   r/reactjs [link]   [comments]