DeloitteAU / react-habitat

⚛️ 🛅 A React DOM Bootstrapper designed to harmonise a hybrid 'CMS + React' application.
Other
262 stars 42 forks source link

Fix lazy loading of components. #31

Closed ryanpcmcquen closed 6 years ago

ryanpcmcquen commented 6 years ago

Closes https://github.com/DeloitteDigitalAPAC/react-habitat/issues/28.

ryanpcmcquen commented 6 years ago

I did not run the built-in tests yet, but locally this fixes lazy loading, as you can see by the *.bundle.js loading in these screenshots:

Loads three bundles (three components on page):

screenshot 1516823313

Loads one bundle (one component on page):

screenshot 1516823302

jennasalau commented 6 years ago

Thanks for your efforts on this one Ryan, really appreciate it!!.

I will merge into a branch and fix the tests.

ryanpcmcquen commented 6 years ago

@jennasalau, thank you! I had started trying to fix the tests, but realized I didn't really know what I was doing. :rofl: