Created by: abhishekakade
Description of PR
- Added React.Lazy and Suspense for better chunking/code-splitting and lazy loading components only as they are needed to be rendered.
- Will make separate chunk files for components like DeepDive, States, PatientDB, Resources, FAQ as they are not needed on initial page load.
- Will reduce the main JS file size that is rendered on initial page load.
- Will reduce page load time and improve performance as components are loaded and rendered as needed.
- After comparing the demo deployment by now bot with the main site, I can see a reduction of about ~275kB on initial page load. From 716kB to 437kB.
Relevant Issues
Fixes #1652 (closed)
Checklist
-
Compiles and passes lint tests -
Properly formatted -
Tested on desktop -
Tested on phone