Code splitting with Onsen React TabBar



  • Hey folks. I’m trying to setup webpack code splitting with Onsen React TabBars, but the TabBar is either architected so it won’t work, or I don’t know how to do it.

    What I’m finding is that each Tab page is rendered even if it’s not the active tab. This causes a huge slowdown in our app.

    Is there a way of lazily loading the page associated with the tab when the tab becomes active?

    Thanks,

    Scott



  • @sherscher Do you have a lot of elements on the tabs? I believe all tabs are now loaded at runtime and remain persistent. If you have a lot of data that will inherently slow down the app, I usually use the show or postchange event to load it when the tab is changed.



  • Yea, each tab is almost an app unto itself. The load time is really bad. Will try to get on-demand loading working.

    Thanks!



  • After using webpack to split each tab’s code into a separate chunk, the load time is pretty good again.

    Thanks!

    Scott


Log in to reply