Ever wondered if React.lazy actually lives up to its name? From a cursory glance, it seems like just a tool to load components when they are actually needed. However, in reality, it's more about breaking code into smaller pieces. Depending on how you have your configuration set up, those pieces can still load before hand β not really "lazy" loading as much as reorganizing your code better.
Shouldnβt React.split / React.defer be the right name? With lazy loading being about delaying resource loading until it's absolutely needed β that's not entirely what React.lazy guarantees.
Even libraries such as react-loadable can't address this completely. Let's redesign how we'd do proper lazy loading in React. Thoughts? π
Top comments (0)