TLDR Web Dev · ARTICLES & TUTORIALS
FASTER LAZY LOADING IN REACT ROUTER V7.5+
Summary from the TLDR Web Dev newsletter
React Router v7.5 introduces a new granular lazy loading API for routes in Data Mode that allows individual route properties—like loader, Component, and middleware—to be lazy-loaded separately. This change was driven by the need to support middleware without degrading performance. Unlike the previous route.lazy() function that loaded everything at once, the new approach allows for faster, more efficient loading by only fetching what's needed at each navigation step.