Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#issue 187 lazy load - dynamic import #218

Merged
merged 5 commits into from
Nov 15, 2023

Conversation

KazemHe
Copy link
Contributor

@KazemHe KazemHe commented Nov 14, 2023

Description

implemented lazy loading for the pages using daynamic import #issue 187

Copy link

netlify bot commented Nov 14, 2023

Deploy Preview for astonishing-pothos-5f81bd ready!

Name Link
🔨 Latest commit ae5592d
🔍 Latest deploy log https://app.netlify.com/sites/astonishing-pothos-5f81bd/deploys/6554b0add699ef0008c09334
😎 Deploy Preview https://deploy-preview-218--astonishing-pothos-5f81bd.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@NoamGaash NoamGaash changed the title #issue 187 lazy load - daynamic import #issue 187 lazy load - dynamic import Nov 14, 2023
@NoamGaash NoamGaash marked this pull request as draft November 14, 2023 22:16
Copy link
Member

@NoamGaash NoamGaash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please ask me for review once conflicts are resolved

@shootermv shootermv marked this pull request as ready for review November 15, 2023 11:10
Comment on lines +3 to +11
import React, { lazy, Suspense } from 'react'
const DashboardPage = lazy(() => import('../pages/dashboard/DashboardPage'))
const TimelinePage = lazy(() => import('../pages/TimelinePage'))
const GapsPage = lazy(() => import('../pages/GapsPage'))
const GapsPatternsPage = lazy(() => import('../pages/gapsPatterns'))
const RealtimeMapPage = lazy(() => import('../pages/RealtimeMapPage'))
const SingleLineMapPage = lazy(() => import('../pages/SingleLineMapPage'))
const About = lazy(() => import('../pages/About'))
import CircularProgress from '@mui/material/CircularProgress'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it won't do the trick.
we want to wait with the loading until the user clicks the menu item - that's not what your code is doing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad.
after reading the documentation, you're 100% right.
it will solve the issue perfectly.
thanks!

@NoamGaash NoamGaash merged commit abf800b into hasadna:main Nov 15, 2023
11 checks passed
@NoamGaash NoamGaash linked an issue Nov 15, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lazy load pages
3 participants